/* /////////////////////////////////////////////////////////////////////////////
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 2008 Intel Corporation. All Rights Reserved.
//
//
//          VC-1 (VC1) encoder, coding tables
//
*/
#include "umc_defs.h"

#if defined (UMC_ENABLE_VC1_VIDEO_ENCODER)

#include "ippvc.h"
#include "umc_vc1_common_enc_tables.h"

namespace UMC_VC1_ENCODER
{
// Tables for encoding intra DC
extern const Ipp32u DCLumaLowMotionEncTableVLC [120*2] =
{
    /*code, len*/
        1, 1,              1, 2,            1,  4,            1, 5,            5, 5,              7, 5,            8,  6,           12, 6,
        0, 7,              2, 7,           18,  7,           26, 7,            3, 8,              7, 8,           39,  8,           55, 8,
        5, 9,             76, 9,          108,  9,          109, 9,            8, 10,            25, 10,          155, 10,          27, 10,
      154, 10,            19, 11,           52, 11,          53, 11,          97, 12,            72, 13,          196, 13,          74, 13,
      198, 13,           199, 13,          146, 14,         395, 14,         147, 14,           387, 14,          386, 14,         150, 14,
      151, 14,           384, 14,          788, 15,         789, 15,        1541, 16,          1540, 16,         1542, 16,        3086, 17,
   197581, 23,        197577, 23,       197576, 23,      197578, 23,      197579, 23,        197580, 23,       197582, 23,      197583, 23,
   197584, 23,        197585, 23,       197586, 23,      197587, 23,      197588, 23,        197589, 23,       197590, 23,      197591, 23,
   197592, 23,        197593, 23,       197594, 23,      197595, 23,      197596, 23,        197597, 23,       197598, 23,      197599, 23,
   197600, 23,        197601, 23,       197602, 23,      197603, 23,      197604, 23,        197605, 23,       197606, 23,      197607, 23,
   197608, 23,        197609, 23,       197610, 23,      197611, 23,      197612, 23,        197613, 23,       197614, 23,      197615, 23,
   197616, 23,        197617, 23,       197618, 23,      197619, 23,      197620, 23,        197621, 23,       197622, 23,      197623, 23,
   197624, 23,        197625, 23,       197626, 23,      197627, 23,      197628, 23,        197629, 23,       197630, 23,      197631, 23,
   395136, 24,        395137, 24,       395138, 24,      395139, 24,      395140, 24,        395141, 24,       395142, 24,      395143, 24,
   395144, 24,        395145, 24,       395146, 24,      395147, 24,      395148, 24,        395149, 24,       395150, 24,      395151, 24
};

extern const Ipp32u DCLumaHighMotionEncTableVLC [120*2] =
{
    /*code, len*/

       2, 2,             3, 2,              3, 3,            2, 4,             5, 4,             1, 5,              3, 5,            8, 5,
       0, 6,             5, 6,             13, 6,           15, 6,            19, 6,             8, 7,             24, 7,           28, 7,
      36, 7,             4, 8,              6, 8,           18, 8,            50, 8,            59, 8,             74, 8,           75, 8,
      11, 9,            38, 9,             39, 9,          102, 9,           116, 9,           117, 9,             20, 10,          28, 10,
      31, 10,           29, 10,            43, 11,          61, 11,          413, 11,          415, 11,            84, 12,         825, 12,
     824, 12,          829, 12,           171, 13,         241, 13,         1656, 13,          242, 13,           480, 14,         481, 14,
     340, 14,         3314, 14,           972, 15,         683, 15,         6631, 15,          974, 15,          6630, 15,        1364, 16,
    1951, 16,         1365, 16,          3901, 17,        3895, 17,         3900, 17,         3893, 17,          7789, 18,        7784, 18,
   15576, 19,        15571, 19,         15577, 19,       31140, 20,       996538, 25,       996532, 25,        996533, 25,      996534, 25,
  996535, 25,       996536, 25,        996537, 25,      996539, 25,       996540, 25,       996541, 25,        996542, 25,      996543, 25,
 1993024, 26,      1993025, 26,       1993026, 26,     1993027, 26,      1993028, 26,      1993029, 26,       1993030, 26,     1993031, 26,
 1993032, 26,      1993033, 26,       1993034, 26,     1993035, 26,      1993036, 26,      1993037, 26,       1993038, 26,     1993039, 26,
 1993040, 26,      1993041, 26,       1993042, 26,     1993043, 26,      1993044, 26,      1993045, 26,       1993046, 26,     1993047, 26,
 1993048, 26,      1993049, 26,       1993050, 26,     1993051, 26,      1993052, 26,      1993053, 26,       1993054, 26,     1993055, 26,
 1993056, 26,      1993057, 26,       1993058, 26,     1993059, 26,      1993060, 26,      1993061, 26,       1993062, 26,     1993063, 26

};


extern const Ipp32u DCChromaLowMotionEncTableVLC [120*2] =
{
    /*code, len*/

       0, 2,          1, 2,           5, 3,           9, 4,           13, 4,         17, 5,          29, 5,          31, 5,
      33, 6,         49, 6,          56, 6,          51, 6,           57, 6,         61, 6,          97, 7,         121, 7,
     128, 8,        200, 8,         202, 8,         240, 8,          129, 8,        192, 8,         201, 8,         263, 9,
     262, 9,        406, 9,         387, 9,         483, 9,          482, 9,        522, 10,        523, 10,       1545, 11,
    1042, 11,      1043, 11,       1547, 11,       1041, 11,        1546, 11,      1631, 11,       1040, 11,       1629, 11,
    1630, 11,      3256, 12,       3088, 12,       3257, 12,        6179, 13,     12357, 14,      24713, 15,      49424, 16,
 3163208, 22,   3163209, 22,    3163210, 22,    3163211, 22,     3163212, 22,   3163213, 22,    3163214, 22,    3163215, 22,
 3163216, 22,   3163217, 22,    3163218, 22,    3163219, 22,     3163220, 22,   3163221, 22,    3163222, 22,    3163223, 22,
 3163224, 22,   3163225, 22,    3163226, 22,    3163227, 22,     3163228, 22,   3163229, 22,    3163230, 22,    3163231, 22,
 3163232, 22,   3163233, 22,    3163234, 22,    3163235, 22,     3163236, 22,   3163237, 22,    3163238, 22,    3163239, 22,
 3163240, 22,   3163241, 22,    3163242, 22,    3163243, 22,     3163244, 22,   3163245, 22,    3163246, 22,    3163247, 22,
 3163248, 22,   3163249, 22,    3163250, 22,    3163251, 22,     3163252, 22,   3163253, 22,    3163254, 22,    3163255, 22,
 3163256, 22,   3163257, 22,    3163258, 22,    3163259, 22,     3163260, 22,   3163261, 22,    3163262, 22,    3163263, 22,
 6326400, 23,   6326401, 23,    6326402, 23,    6326403, 23,     6326404, 23,   6326405, 23,    6326406, 23,    6326407, 23,
 6326408, 23,   6326409, 23,    6326410, 23,    6326411, 23,     6326412, 23,   6326413, 23,    6326414, 23,    6326415, 23

};

extern const Ipp32u DCCromaHighMotionEncTableVLC [120*2] =

{
    /*code, len*/

           0, 2,            1, 2,           4, 3,           7, 3,          11, 4,          13, 4,          21, 5,          40, 6,
          48, 6,           50, 6,          82, 7,          98, 7,         102, 7,         166, 8,         198, 8,         207, 8,
         335, 9,          398, 9,         412, 9,         669, 10,        826, 10,       1336, 11,       1596, 11,       1598, 11,
        1599, 11,        1654, 11,       2675, 12,       3194, 12,       3311, 12,       5349, 13,       6621, 13,      10696, 14,
       10697, 14,       25565, 15,      13240, 14,      13241, 14,      51126, 16,      25560, 15,      25567, 15,      51123, 16,
       51124, 16,       51125, 16,      25566, 15,      51127, 16,      51128, 16,      51129, 16,     102245, 17,     204488, 18,
    13087304, 24,    13087305, 24,   13087306, 24,   13087307, 24,   13087308, 24,   13087309, 24,   13087310, 24,   13087311, 24,
    13087312, 24,    13087313, 24,   13087314, 24,   13087315, 24,   13087316, 24,   13087317, 24,   13087318, 24,   13087319, 24,
    13087320, 24,    13087321, 24,   13087322, 24,   13087323, 24,   13087324, 24,   13087325, 24,   13087326, 24,   13087327, 24,
    13087328, 24,    13087329, 24,   13087330, 24,   13087331, 24,   13087332, 24,   13087333, 24,   13087334, 24,   13087335, 24,
    13087336, 24,    13087337, 24,   13087338, 24,   13087339, 24,   13087340, 24,   13087341, 24,   13087342, 24,   13087343, 24,
    13087344, 24,    13087345, 24,   13087346, 24,   13087347, 24,   13087348, 24,   13087349, 24,   13087350, 24,   13087351, 24,
    13087352, 24,    13087353, 24,   13087354, 24,   13087355, 24,   13087356, 24,   13087357, 24,   13087358, 24,   13087359, 24,
    26174592, 25,    26174593, 25,   26174594, 25,   26174595, 25,   26174596, 25,   26174597, 25,   26174598, 25,   26174599, 25,
    26174600, 25,    26174601, 25,   26174602, 25,   26174603, 25,   26174604, 25,   26174605, 25,   26174606, 25,   26174607, 25
};



extern const Ipp8u HighMotionIntraIndexLevelLast0[31] =
{
    /*  level        run        index*/
    /*1..    19    ,    0    */    0      ,
    /*1..    15    ,    1    */    19     ,
    /*1..    12    ,    2    */    34     ,
    /*1..    11    ,    3    */    46     ,
    /*1..    6    ,    4     */    57     ,
    /*1..    5    ,    5     */    63     ,
    /*1..    4    ,    6     */    68     ,
    /*1..    4    ,    7     */    72     ,
    /*1..    4    ,    8     */    76     ,
    /*1..    4    ,    9     */    80     ,
    /*1..    3    ,    10    */    84     ,
    /*1..    3    ,    11    */    87     ,
    /*1..    3    ,    12    */    90     ,
    /*1..    3    ,    13    */    93     ,
    /*1..    3    ,    14    */    96     ,
    /*1..    3    ,    15    */    99     ,
    /*1..    2    ,    16    */    102    ,
    /*1..    2    ,    17    */    104    ,
    /*1..    1    ,    18    */    106    ,
    /*1..    1    ,    19    */    107    ,
    /*1..    1    ,    20    */    108    ,
    /*1..    1    ,    21    */    109    ,
    /*1..    1    ,    22    */    110    ,
    /*1..    1    ,    23    */    111    ,
    /*1..    1    ,    24    */    112    ,
    /*1..    1    ,    25    */    113    ,
    /*1..    1    ,    26    */    114    ,
    /*1..    1    ,    27    */    115    ,
    /*1..    1    ,    28    */    116    ,
    /*1..    1    ,    29    */    117    ,
    /*1..    1    ,    30    */    118
};
extern const Ipp8u HighMotionIntraIndexLevelLast1[38] =
{
    /*  level     run        index*/
    /*1..    6    ,    0     */    119    ,
    /*1..    5    ,    1     */    125    ,
    /*1..    4    ,    2     */    130    ,
    /*1..    4    ,    3     */    134    ,
    /*1..    3    ,    4     */    138    ,
    /*1..    2    ,    5     */    141    ,
    /*1..    2    ,    6     */    143    ,
    /*1..    2    ,    7     */    145    ,
    /*1..    2    ,    8     */    147    ,
    /*1..    2    ,    9     */    149    ,
    /*1..    2    ,    10    */    151    ,
    /*1..    2    ,    11    */    153    ,
    /*1..    2    ,    12    */    155    ,
    /*1..    2    ,    13    */    157    ,
    /*1..    2    ,    14    */    159    ,
    /*1..    2    ,    15    */    161    ,
    /*1..    1    ,    16    */    163    ,
    /*1..    1    ,    17    */    164    ,
    /*1..    1    ,    18    */    165    ,
    /*1..    1    ,    19    */    166    ,
    /*1..    1    ,    20    */    167    ,
    /*1..    1    ,    21    */    168    ,
    /*1..    1    ,    22    */    169    ,
    /*1..    1    ,    23    */    170    ,
    /*1..    1    ,    24    */    171    ,
    /*1..    1    ,    25    */    172    ,
    /*1..    1    ,    26    */    173    ,
    /*1..    1    ,    27    */    174    ,
    /*1..    1    ,    28    */    175    ,
    /*1..    1    ,    29    */    176    ,
    /*1..    1    ,    30    */    177    ,
    /*1..    1    ,    31    */    178    ,
    /*1..    1    ,    32    */    179    ,
    /*1..    1    ,    33    */    180    ,
    /*1..    1    ,    34    */    181    ,
    /*1..    1    ,    35    */    182    ,
    /*1..    1    ,    36    */    183    ,
    /*1..    1    ,    37    */    184
};

extern const Ipp8u LowMotionIntraIndexLevelLast0[21] =
{
    /*  level       run        index*/
    /*1..    16    ,    0    */     0     ,
    /*1..    11    ,    1    */     16    ,
    /*1..    8    ,    2     */     27    ,
    /*1..    7    ,    3     */     35    ,
    /*1..    5    ,    4     */     42    ,
    /*1..    4    ,    5     */     47    ,
    /*1..    4        6      */     51    ,
    /*1..    3        7      */     55    ,
    /*1..    3        8      */     58    ,
    /*1..    3        9      */     61    ,
    /*1..    3        10     */     64    ,
    /*1..    3        11     */     67    ,
    /*1..    3        12     */     70    ,
    /*1..    3        13     */     73    ,
    /*1..    2        14     */     76    ,
    /*1..    2        15     */     78    ,
    /*1..    1        16     */     80    ,
    /*1..    1        17     */     81    ,
    /*1..    1        18     */     82    ,
    /*1..    1        19     */     83    ,
    /*1..    1        20     */     84
};


extern const Ipp8u LowMotionIntraIndexLevelLast1[27] =
{
    /*  level        run        index*/
    /*1..    4    ,    0    */    85     ,
    /*1..    4    ,    1    */    89     ,
    /*1..    3    ,    2    */    93     ,
    /*1..    3    ,    3    */    96     ,
    /*1..    2    ,    4    */    99     ,
    /*1..    2    ,    5    */    101    ,
    /*1..    2        6     */    103    ,
    /*1..    2        7     */    105    ,
    /*1..    2        8     */    107    ,
    /*1..    2        9     */    109    ,
    /*1..    2        10    */    111    ,
    /*1..    2        11    */    113    ,
    /*1..    2        12    */    115    ,
    /*1..    2        13    */    117    ,
    /*1..    1        14    */    119    ,
    /*1..    1        15    */    120    ,
    /*1..    1        16    */    121    ,
    /*1..    1        17    */    122    ,
    /*1..    1        18    */    123    ,
    /*1..    1        19    */    124    ,
    /*1..    1        20    */    125    ,
    /*1..    1        21    */    126    ,
    /*1..    1        22    */    127    ,
    /*1..    1        23    */    128    ,
    /*1..    1        24    */    129    ,
    /*1..    1        25    */    130    ,
    /*1..    1        26    */    131

};
extern const Ipp8u MidRateIntraIndexLevelLast0[15] =
{
    /*  level        run        index*/
    /*1..    27    ,    0    */    0     ,
    /*1..    10    ,    1    */    27    ,
    /*1..    5    ,    2     */    37    ,
    /*1..    4    ,    3     */    42    ,
    /*1..    3    ,    4     */    46    ,
    /*1..    3    ,    5     */    49    ,
    /*1..    3    ,    6     */    52    ,
    /*1..    3    ,    7     */    55    ,
    /*1..    2    ,    8     */    58    ,
    /*1..    2    ,    9     */    60    ,
    /*1..    1    ,    10    */    62    ,
    /*1..    1    ,    11    */    63    ,
    /*1..    1    ,    12    */    64    ,
    /*1..    1    ,    13    */    65    ,
    /*1..    1    ,    14    */    66

};

extern const Ipp8u MidRateIntraIndexLevelLast1[21] =
{
    /*  level        run        index*/
    /*1..    8    ,    0     */    67    ,
    /*1..    3    ,    1     */    75    ,
    /*1..    2    ,    2     */    78    ,
    /*1..    2    ,    3     */    80    ,
    /*1..    2    ,    4     */    82    ,
    /*1..    2    ,    5     */    84    ,
    /*1..    2    ,    6     */    86    ,
    /*1..    1    ,    7     */    88    ,
    /*1..    1    ,    8     */    89    ,
    /*1..    1    ,    9     */    90    ,
    /*1..    1    ,    10    */    91    ,
    /*1..    1    ,    11    */    92    ,
    /*1..    1    ,    12    */    93    ,
    /*1..    1    ,    13    */    94    ,
    /*1..    1    ,    14    */    95    ,
    /*1..    1    ,    15    */    96    ,
    /*1..    1    ,    16    */    97    ,
    /*1..    1    ,    17    */    98    ,
    /*1..    1    ,    18    */    99    ,
    /*1..    1    ,    19    */    100   ,
    /*1..    1    ,    20    */    101

};
extern const Ipp8u HighRateIntraIndexLevelLast0[15] =
{
    /*  level     run        index*/
    /*1..    56    ,    0    */    0      ,
    /*1..    20    ,    1    */    56     ,
    /*1..    10    ,    2    */    76     ,
    /*1..    7    ,    3     */    86     ,
    /*1..    6    ,    4     */    93     ,
    /*1..    5    ,    5     */    99     ,
    /*1..    4    ,    6     */    104    ,
    /*1..    3    ,    7     */    108    ,
    /*1..    3    ,    8     */    111    ,
    /*1..    3    ,    9     */    114    ,
    /*1..    2    ,    10    */    117    ,
    /*1..    2    ,    11    */    119    ,
    /*1..    2    ,    12    */    121    ,
    /*1..    2    ,    13    */    123    ,
    /*1..    1    ,    14    */    125

};


extern const Ipp8u HighRateIntraIndexLevelLast1[17] =
{
    /*  level        run        index*/
    /*1..    4    ,    0    */    126    ,
    /*1..    3    ,    1    */    130    ,
    /*1..    3    ,    2    */    133    ,
    /*1..    2    ,    3    */    136    ,
    /*1..    2    ,    4    */    138    ,
    /*1..    2    ,    5    */    140    ,
    /*1..    2    ,    6    */    142    ,
    /*1..    2    ,    7    */    144    ,
    /*1..    2    ,    8    */    146    ,
    /*1..    2    ,    9    */    148    ,
    /*1..    2    ,    10   */    150    ,
    /*1..    2    ,    11   */    152    ,
    /*1..    2    ,    12   */    154    ,
    /*1..    2    ,    13   */    156    ,
    /*1..    2    ,    14   */    158    ,
    /*1..    1        15    */    160    ,
    /*1..    1        16    */    161
};
extern const Ipp8u HighMotionInterIndexLevelLast0[27]=
{
    /*1..   23  ,   0   */  0   ,
    /*1..   11  ,   1   */  23  ,
    /*1..   8   ,   2   */  34  ,
    /*1..   7   ,   3   */  42  ,
    /*1..   5   ,   4   */  49  ,
    /*1..   5   ,   5   */  54  ,
    /*1..   4   ,   6   */  59  ,
    /*1..   4   ,   7   */  63  ,
    /*1..   3   ,   8   */  67  ,
    /*1..   3   ,   9   */  70  ,
    /*1..   3   ,   10  */  73  ,
    /*1..   3   ,   11  */  76  ,
    /*1..   2   ,   12  */  79  ,
    /*1..   2   ,   13  */  81  ,
    /*1..   2   ,   14  */  83  ,
    /*1..   2   ,   15  */  85  ,
    /*1..   2   ,   16  */  87  ,
    /*1..   1   ,   17  */  89  ,
    /*1..   1   ,   18  */  90  ,
    /*1..   1   ,   19  */  91  ,
    /*1..   1   ,   20  */  92  ,
    /*1..   1   ,   21  */  93  ,
    /*1..   1   ,   22  */  94  ,
    /*1..   1   ,   23  */  95  ,
    /*1..   1   ,   24  */  96  ,
    /*1..   1   ,   25  */  97  ,
    /*1..   1   ,   26  */  98
};
extern const Ipp8u HighMotionInterIndexLevelLast1[37]=
{
    /*1..   9   ,   0   */  99  ,
    /*1..   5   ,   1   */  108 ,
    /*1..   4   ,   2   */  113 ,
    /*1..   4   ,   3   */  117 ,
    /*1..   3   ,   4   */  121 ,
    /*1..   3   ,   5   */  124 ,
    /*1..   3   ,   6   */  127 ,
    /*1..   2   ,   7   */  130 ,
    /*1..   2   ,   8   */  132 ,
    /*1..   2   ,   9   */  134 ,
    /*1..   2   ,   10  */  136 ,
    /*1..   2   ,   11  */  138 ,
    /*1..   2   ,   12  */  140 ,
    /*1..   2   ,   13  */  142 ,
    /*1..   2   ,   14  */  144 ,
    /*1..   1   ,   15  */  146 ,
    /*1..   1   ,   16  */  147 ,
    /*1..   1   ,   17  */  148 ,
    /*1..   1   ,   18  */  149 ,
    /*1..   1   ,   19  */  150 ,
    /*1..   1   ,   20  */  151 ,
    /*1..   1   ,   21  */  152 ,
    /*1..   1   ,   22  */  153 ,
    /*1..   1   ,   23  */  154 ,
    /*1..   1   ,   24  */  155 ,
    /*1..   1   ,   25  */  156 ,
    /*1..   1   ,   26  */  157 ,
    /*1..   1   ,   27  */  158 ,
    /*1..   1   ,   28  */  159 ,
    /*1..   1   ,   29  */  160 ,
    /*1..   1   ,   30  */  161 ,
    /*1..   1   ,   31  */  162 ,
    /*1..   1   ,   32  */  163 ,
    /*1..   1   ,   33  */  164 ,
    /*1..   1   ,   34  */  165 ,
    /*1..   1   ,   35  */  166 ,
    /*1..   1   ,   36  */  167
};
extern const Ipp8u LowMotionInterIndexLevelLast0[30]=
{
    /*1..   14  ,   0   */  0   ,
    /*1..   9   ,   1   */  14  ,
    /*1..   5   ,   2   */  23  ,
    /*1..   4   ,   3   */  28  ,
    /*1..   4   ,   4   */  32  ,
    /*1..   4   ,   5   */  36  ,
    /*1..   3   ,   6   */  40  ,
    /*1..   3   ,   7   */  43  ,
    /*1..   3   ,   8   */  46  ,
    /*1..   3   ,   9   */  49  ,
    /*1..   3   ,   10  */  52  ,
    /*1..   3   ,   11  */  55  ,
    /*1..   3   ,   12  */  58  ,
    /*1..   2   ,   13  */  61  ,
    /*1..   2   ,   14  */  63  ,
    /*1..   2   ,   15  */  65  ,
    /*1..   1   ,   16  */  67  ,
    /*1..   1   ,   17  */  68  ,
    /*1..   1   ,   18  */  69  ,
    /*1..   1   ,   19  */  70  ,
    /*1..   1   ,   20  */  71  ,
    /*1..   1   ,   21  */  72  ,
    /*1..   1   ,   22  */  73  ,
    /*1..   1   ,   23  */  74  ,
    /*1..   1   ,   24  */  75  ,
    /*1..   1   ,   25  */  76  ,
    /*1..   1   ,   26  */  77  ,
    /*1..   1   ,   27  */  78  ,
    /*1..   1   ,   28  */  79  ,
    /*1..   1   ,   29  */  80
};
extern const Ipp8u LowMotionInterIndexLevelLast1[44]=
{
    /*1..   5   ,   0   */  81  ,
    /*1..   4   ,   1   */  86  ,
    /*1..   3   ,   2   */  90  ,
    /*1..   3   ,   3   */  93  ,
    /*1..   2   ,   4   */  96  ,
    /*1..   2   ,   5   */  98  ,
    /*1..   2   ,   6   */  100 ,
    /*1..   2   ,   7   */  102 ,
    /*1..   2   ,   8   */  104 ,
    /*1..   2   ,   9   */  106 ,
    /*1..   2   ,   10  */  108 ,
    /*1..   2   ,   11  */  110 ,
    /*1..   2   ,   12  */  112 ,
    /*1..   2   ,   13  */  114 ,
    /*1..   2   ,   14  */  116 ,
    /*1..   2   ,   15  */  118 ,
    /*1..   1   ,   16  */  120 ,
    /*1..   1   ,   17  */  121 ,
    /*1..   1   ,   18  */  122 ,
    /*1..   1   ,   19  */  123 ,
    /*1..   1   ,   20  */  124 ,
    /*1..   1   ,   21  */  125 ,
    /*1..   1   ,   22  */  126 ,
    /*1..   1   ,   23  */  127 ,
    /*1..   1   ,   24  */  128 ,
    /*1..   1   ,   25  */  129 ,
    /*1..   1   ,   26  */  130 ,
    /*1..   1   ,   27  */  131 ,
    /*1..   1   ,   28  */  132 ,
    /*1..   1   ,   29  */  133 ,
    /*1..   1   ,   30  */  134 ,
    /*1..   1   ,   31  */  135 ,
    /*1..   1   ,   32  */  136 ,
    /*1..   1   ,   33  */  137 ,
    /*1..   1   ,   34  */  138 ,
    /*1..   1   ,   35  */  139 ,
    /*1..   1   ,   36  */  140 ,
    /*1..   1   ,   37  */  141 ,
    /*1..   1   ,   38  */  142 ,
    /*1..   1   ,   39  */  143 ,
    /*1..   1   ,   40  */  144 ,
    /*1..   1   ,   41  */  145 ,
    /*1..   1   ,   42  */  146 ,
    /*1..   1   ,   43  */  147
};

extern const Ipp8u MidRateInterIndexLevelLast0[27]=
{
    /*1..   12  ,   0   */  0   ,
    /*1..   6   ,   1   */  12  ,
    /*1..   4   ,   2   */  18  ,
    /*1..   3   ,   3   */  22  ,
    /*1..   3   ,   4   */  25  ,
    /*1..   3   ,   5   */  28  ,
    /*1..   3   ,   6   */  31  ,
    /*1..   2   ,   7   */  34  ,
    /*1..   2   ,   8   */  36  ,
    /*1..   2   ,   9   */  38  ,
    /*1..   2   ,   10  */  40  ,
    /*1..   1   ,   11  */  42  ,
    /*1..   1   ,   12  */  43  ,
    /*1..   1   ,   13  */  44  ,
    /*1..   1   ,   14  */  45  ,
    /*1..   1   ,   15  */  46  ,
    /*1..   1   ,   16  */  47  ,
    /*1..   1   ,   17  */  48  ,
    /*1..   1   ,   18  */  49  ,
    /*1..   1   ,   19  */  50  ,
    /*1..   1   ,   20  */  51  ,
    /*1..   1   ,   21  */  52  ,
    /*1..   1   ,   22  */  53  ,
    /*1..   1   ,   23  */  54  ,
    /*1..   1   ,   24  */  55  ,
    /*1..   1   ,   25  */  56  ,
    /*1..   1   ,   26  */  57
};
extern  const Ipp8u MidRateInterIndexLevelLast1[41]=
{
    /*1..   3   ,   0   */  58  ,
    /*1..   2   ,   1   */  61  ,
    /*1..   1   ,   2   */  63  ,
    /*1..   1   ,   3   */  64  ,
    /*1..   1   ,   4   */  65  ,
    /*1..   1   ,   5   */  66  ,
    /*1..   1   ,   6   */  67  ,
    /*1..   1   ,   7   */  68  ,
    /*1..   1   ,   8   */  69  ,
    /*1..   1   ,   9   */  70  ,
    /*1..   1   ,   10  */  71  ,
    /*1..   1   ,   11  */  72  ,
    /*1..   1   ,   12  */  73  ,
    /*1..   1   ,   13  */  74  ,
    /*1..   1   ,   14  */  75  ,
    /*1..   1   ,   15  */  76  ,
    /*1..   1   ,   16  */  77  ,
    /*1..   1   ,   17  */  78  ,
    /*1..   1   ,   18  */  79  ,
    /*1..   1   ,   19  */  80  ,
    /*1..   1   ,   20  */  81  ,
    /*1..   1   ,   21  */  82  ,
    /*1..   1   ,   22  */  83  ,
    /*1..   1   ,   23  */  84  ,
    /*1..   1   ,   24  */  85  ,
    /*1..   1   ,   25  */  86  ,
    /*1..   1   ,   26  */  87  ,
    /*1..   1   ,   27  */  88  ,
    /*1..   1   ,   28  */  89  ,
    /*1..   1   ,   29  */  90  ,
    /*1..   1   ,   30  */  91  ,
    /*1..   1   ,   31  */  92  ,
    /*1..   1   ,   32  */  93  ,
    /*1..   1   ,   33  */  94  ,
    /*1..   1   ,   34  */  95  ,
    /*1..   1   ,   35  */  96  ,
    /*1..   1   ,   36  */  97  ,
    /*1..   1   ,   37  */  98  ,
    /*1..   1   ,   38  */  99  ,
    /*1..   1   ,   39  */  100 ,
    /*1..   1   ,   40  */  101
};

extern const Ipp8u HighRateInterIndexLevelLast0[25]=
{
    /*1..   32  ,   0   */  0   ,
    /*1..   13  ,   1   */  32  ,
    /*1..   8   ,   2   */  45  ,
    /*1..   6   ,   3   */  53  ,
    /*1..   5   ,   4   */  59  ,
    /*1..   4   ,   5   */  64  ,
    /*1..   4   ,   6   */  68  ,
    /*1..   3   ,   7   */  72  ,
    /*1..   3   ,   8   */  75  ,
    /*1..   3   ,   9   */  78  ,
    /*1..   2   ,   10  */  81  ,
    /*1..   2   ,   11  */  83  ,
    /*1..   2   ,   12  */  85  ,
    /*1..   2   ,   13  */  87  ,
    /*1..   2   ,   14  */  89  ,
    /*1..   2   ,   15  */  91  ,
    /*1..   2   ,   16  */  93  ,
    /*1..   2   ,   17  */  95  ,
    /*1..   2   ,   18  */  97  ,
    /*1..   2   ,   19  */  99  ,
    /*1..   2   ,   20  */  101 ,
    /*1..   2   ,   21  */  103 ,
    /*1..   2   ,   22  */  105 ,
    /*1..   1   ,   23  */  107 ,
    /*1..   1   ,   24  */  108
};
extern const Ipp8u HighRateInterIndexLevelLast1[31]=
{
    /*1..   4   ,   0   */  109 ,
    /*1..   3   ,   1   */  113 ,
    /*1..   3   ,   2   */  116 ,
    /*1..   3   ,   3   */  119 ,
    /*1..   2   ,   4   */  122 ,
    /*1..   2   ,   5   */  124 ,
    /*1..   2   ,   6   */  126 ,
    /*1..   2   ,   7   */  128 ,
    /*1..   2   ,   8   */  130 ,
    /*1..   2   ,   9   */  132 ,
    /*1..   2   ,   10  */  134 ,
    /*1..   2   ,   11  */  136 ,
    /*1..   2   ,   12  */  138 ,
    /*1..   2   ,   13  */  140 ,
    /*1..   2   ,   14  */  142 ,
    /*1..   2   ,   15  */  144 ,
    /*1..   2   ,   16  */  146 ,
    /*1..   2   ,   17  */  148 ,
    /*1..   2   ,   18  */  150 ,
    /*1..   2   ,   19  */  152 ,
    /*1..   2   ,   20  */  154 ,
    /*1..   2   ,   21  */  156 ,
    /*1..   2   ,   22  */  158 ,
    /*1..   2   ,   23  */  160 ,
    /*1..   2   ,   24  */  162 ,
    /*1..   2   ,   25  */  164 ,
    /*1..   2   ,   26  */  166 ,
    /*1..   2   ,   27  */  168 ,
    /*1..   2   ,   28  */  170 ,
    /*1..   1   ,   29  */  172 ,
    /*1..   1   ,   30  */  173
};



extern const Ipp32u LowMotionIntraTableVLC[133*2]=
{
/*ESCAPE*/
            22    , 7    ,                  1     ,  2   ,
            6     , 3    ,                  15    ,  4   ,
            22    , 5    ,                  32    ,  6   ,
            24    , 7    ,                  8     ,  8   ,
            154   , 8    ,                  86    ,  9   ,
            318   , 9    ,                  240   ,  10  ,
            933   , 10   ,                  119   ,  11  ,
            495   , 11   ,                  154   ,  12  ,
            93    , 13   ,                  1     ,  4   ,
            17    , 5    ,                  2     ,  7   ,
            11    , 8    ,                  18    ,  9   ,
            470   , 9    ,                  638   ,  10  ,
            401   , 11   ,                  234   ,  12  ,
            988   , 12   ,                  315   ,  13  ,
            4     , 5    ,                  20    ,  7   ,
            158   , 8    ,                  9     ,  10  ,
            428   , 11   ,                  482   ,  11  ,
            970   , 12   ,                  95    ,  13  ,
            23    , 5    ,                  78    ,  7   ,
            94    , 9    ,                  243   ,  10  ,
            429   , 11   ,                  236   ,  12  ,
            1520  , 13   ,                  14    ,  6   ,
            225   , 8    ,                  932   ,  10  ,
            156   , 12   ,                  317   ,  13  ,
            59    , 6    ,                  28    ,  9   ,
            20    , 11   ,                  2494  ,  12  ,
            6     , 7    ,                  122   ,  9   ,
            400   , 11   ,                  311   ,  13  ,
            27    , 7    ,                  8     ,  10  ,
            1884  , 11   ,                  113   ,  7   ,
            215   , 10   ,                  2495  ,  12  ,
            7     , 8    ,                  175   ,  10  ,
            1228  , 11   ,                  52    ,  8   ,
            613   , 10   ,                  159   ,  12  ,
            224   , 8    ,                  22    ,  11  ,
            807   , 12   ,                  21    ,  9   ,
            381   , 11   ,                  3771  ,  12  ,
            20    , 9    ,                  246   ,  10  ,
            484   , 11   ,                  203   ,  10  ,
            2461  , 12   ,                  202   ,  10  ,
            764   , 12   ,                  383   ,  11  ,
            1229  , 11   ,                  765   ,  12  ,
            1278  , 11   ,                  314   ,  13  ,
            10    , 4    ,                  66    ,  7   ,
            467   , 9    ,                  1245  ,  11  ,
            18    , 5    ,                  232   ,  8   ,
            76    , 11   ,                  310   ,  13  ,
            57    , 6    ,                  612   ,  10  ,
            3770  , 12   ,                  0     ,  7   ,
            174   , 10   ,                  2460  ,  12  ,
            31    , 7    ,                  1246  ,  11  ,
            67    , 7    ,                  1244  ,  11  ,
            3     , 8    ,                  971   ,  12  ,
            6     , 8    ,                  2462  ,  12  ,
            42    , 8    ,                  1521  ,  13  ,
            15    , 8    ,                  2558  ,  12  ,
            51    , 8    ,                  2559  ,  12  ,
            152   , 8    ,                  2463  ,  12  ,
            234   , 8    ,                  316   ,  13  ,
            46    , 8    ,                  402   ,  11  ,
            310   , 9    ,                  106   ,  9   ,
            21    , 11   ,                  943   ,  10  ,
            483   , 11   ,                  116   ,  11  ,
            235   , 12   ,                  761   ,  12  ,
            92    , 13   ,                  237   ,  12  ,
            989   , 12   ,                  806   ,  12  ,
            94    , 13
};
extern const Ipp32u HighMotionIntraTableVLC[186*2]=
{
/*ESCAPE*/  74      ,    9    ,            1       ,    2    ,
            5       ,    3    ,            13      ,    4    ,
            18      ,    5    ,            14      ,    6    ,
            21      ,    7    ,            19      ,    8    ,
            63      ,    8    ,            75      ,    9    ,
            287     ,    9    ,            184     ,    10   ,
            995     ,    10   ,            370     ,    11   ,
            589     ,    12   ,            986     ,    12   ,
            733     ,    13   ,            8021    ,    13   ,
            1465    ,    14   ,            16046   ,    14   ,
            0       ,    4    ,            16      ,    5    ,
            8       ,    7    ,            32      ,    8    ,
            41      ,    9    ,            500     ,    9    ,
            563     ,    10   ,            480     ,    11   ,
            298     ,    12   ,            989     ,    12   ,
            1290    ,    13   ,            7977    ,    13   ,
            2626    ,    14   ,            4722    ,    15   ,
            5943    ,    15   ,            3       ,    5    ,
            17      ,    7    ,            196     ,    8    ,
            75      ,    10   ,            180     ,    11   ,
            2004    ,    11   ,            837     ,    12   ,
            727     ,    13   ,            1983    ,    13   ,
            2360    ,    14   ,            3003    ,    14   ,
            2398    ,    15   ,            19      ,    5    ,
            120     ,    7    ,            105     ,    9    ,
            562     ,    10   ,            1121    ,    11   ,
            1004    ,    12   ,            1312    ,    13   ,
            7978    ,    13   ,            15952   ,    14   ,
            15953   ,    14   ,            5254    ,    15   ,
            12      ,    6    ,            36      ,    9    ,
            148     ,    11   ,            2240    ,    12   ,
            3849    ,    14   ,            7920    ,    15   ,
            61      ,    6    ,            83      ,    9    ,
            416     ,    11   ,            726     ,    13   ,
            3848    ,    14   ,            19      ,    7    ,
            124     ,    9    ,            1985    ,    11   ,
            1196    ,    14   ,            27      ,    7    ,
            160     ,    10   ,            836     ,    12   ,
            3961    ,    14   ,            121     ,    7    ,
            993     ,    10   ,            724     ,    13   ,
            8966    ,    14   ,            33      ,    8    ,
            572     ,    10   ,            4014    ,    12   ,
            9182    ,    14   ,            53      ,    8    ,
            373     ,    11   ,            1971    ,    13   ,
            197     ,    8    ,            372     ,    11   ,
            1925    ,    13   ,            72      ,    9    ,
            419     ,    11   ,            1182    ,    13   ,
            44      ,    9    ,            250     ,    10   ,
            2006    ,    11   ,            146     ,    10   ,
            1484    ,    13   ,            7921    ,    15   ,
            163     ,    10   ,            1005    ,    12   ,
            2366    ,    14   ,            482     ,    11   ,
            4723    ,    15   ,            1988    ,    11   ,
            5255    ,    15   ,            657     ,    12   ,
            659     ,    12   ,            3978    ,    12   ,
            1289    ,    13   ,            1288    ,    13   ,
            1933    ,    13   ,            1982    ,    13   ,
            1932    ,    13   ,            1198    ,    14   ,
            3002    ,    14   ,            8967    ,    14   ,
            2970    ,    14   ,            5942    ,    15   ,
            14      ,    4    ,            69      ,    7    ,
            499     ,    9    ,            1146    ,    11   ,
            1500    ,    13   ,            9183    ,    14   ,
            25      ,    5    ,            40      ,    9    ,
            374     ,    11   ,            1181    ,    13   ,
            9181    ,    14   ,            48      ,    6    ,
            162     ,    10   ,            751     ,    12   ,
            1464    ,    14   ,            63      ,    6    ,
            165     ,    10   ,            987     ,    12   ,
            2367    ,    14   ,            68      ,    7    ,
            1995    ,    11   ,            2399    ,    15   ,
            99      ,    7    ,            963     ,    12   ,
            21      ,    8    ,            2294    ,    12   ,
            23      ,    8    ,            1176    ,    13   ,
            44      ,    8    ,            1970    ,    13   ,
            47      ,    8    ,            8020    ,    13   ,
            141     ,    8    ,            1981    ,    13   ,
            142     ,    8    ,            4482    ,    13   ,
            251     ,    8    ,            1291    ,    13   ,
            45      ,    8    ,            1984    ,    11   ,
            121     ,    9    ,            8031    ,    13   ,
            122     ,    9    ,            8022    ,    13   ,
            561     ,    10   ,            996     ,    10   ,
            417     ,    11   ,            323     ,    11   ,
            503     ,    11   ,            367     ,    12   ,
            658     ,    12   ,            743     ,    12   ,
            364     ,    12   ,            365     ,    12   ,
            988     ,    12   ,            3979    ,    12   ,
            1177    ,    13   ,            984     ,    12   ,
            1934    ,    13   ,            725     ,    13   ,
            8030    ,    13   ,            7979    ,    13   ,
            1935    ,    13   ,            1197    ,    14   ,
            16047   ,    14   ,            9180    ,    14
};
extern const Ipp32u MidRateIntraTableVLC[103*2]=
{
/*ESCAPE*/  3   ,   7   ,            2   ,   2   ,
            6   ,   3   ,            15  ,   4   ,
            13  ,   5   ,            12  ,   5   ,
            21  ,   6   ,            19  ,   6   ,
            18  ,   6   ,            23  ,   7   ,
            31  ,   8   ,            30  ,   8   ,
            29  ,   8   ,            37  ,   9   ,
            36  ,   9   ,            35  ,   9   ,
            33  ,   9   ,            33  ,   10  ,
            32  ,   10  ,            15  ,   10  ,
            14  ,   10  ,            7   ,   11  ,
            6   ,   11  ,            32  ,   11  ,
            33  ,   11  ,            80  ,   12  ,
            81  ,   12  ,            82  ,   12  ,
            14  ,   4   ,            20  ,   6   ,
            22  ,   7   ,            28  ,   8   ,
            32  ,   9   ,            31  ,   9   ,
            13  ,   10  ,            34  ,   11  ,
            83  ,   12  ,            85  ,   12  ,
            11  ,   5   ,            21  ,   7   ,
            30  ,   9   ,            12  ,   10  ,
            86  ,   12  ,            17  ,   6   ,
            27  ,   8   ,            29  ,   9   ,
            11  ,   10  ,            16  ,   6   ,
            34  ,   9   ,            10  ,   10  ,
            13  ,   6   ,            28  ,   9   ,
            8   ,   10  ,            18  ,   7   ,
            27  ,   9   ,            84  ,   12  ,
            20  ,   7   ,            26  ,   9   ,
            87  ,   12  ,            25  ,   8   ,
            9   ,   10  ,            24  ,   8   ,
            35  ,   11  ,            23  ,   8   ,
            25  ,   9   ,            24  ,   9   ,
            7   ,   10  ,            88  ,   12  ,
            7   ,   4   ,            12  ,   6   ,
            22  ,   8   ,            23  ,   9   ,
            6   ,   10  ,            5   ,   11  ,
            4   ,   11  ,            89  ,   12  ,
            15  ,   6   ,            22  ,   9   ,
            5   ,   10  ,            14  ,   6   ,
            4   ,   10  ,            17  ,   7   ,
            36  ,   11  ,            16  ,   7   ,
            37  ,   11  ,            19  ,   7   ,
            90  ,   12  ,            21  ,   8   ,
            91  ,   12  ,            20  ,   8   ,
            19  ,   8   ,            26  ,   8   ,
            21  ,   9   ,            20  ,   9   ,
            19  ,   9   ,            18  ,   9   ,
            17  ,   9   ,            38  ,   11  ,
            39  ,   11  ,            92  ,   12  ,
            93  ,   12  ,            94  ,   12  ,
            95  ,   12
};
extern const Ipp32u HighRateIntraTableVLC[163*2]=
{
/*ESCAPE*/  122     ,   7   ,           0       ,   2   ,
            3       ,   3   ,           13      ,   4   ,
            5       ,   4   ,           28      ,   5   ,
            22      ,   5   ,           63      ,   6   ,
            58      ,   6   ,           46      ,   6   ,
            34      ,   6   ,           123     ,   7   ,
            103     ,   7   ,           95      ,   7   ,
            71      ,   7   ,           38      ,   7   ,
            239     ,   8   ,           205     ,   8   ,
            193     ,   8   ,           169     ,   8   ,
            79      ,   8   ,           498     ,   9   ,
            477     ,   9   ,           409     ,   9   ,
            389     ,   9   ,           349     ,   9   ,
            283     ,   9   ,           1007    ,   10  ,
            993     ,   10  ,           968     ,   10  ,
            817     ,   10  ,           771     ,   10  ,
            753     ,   10  ,           672     ,   10  ,
            563     ,   10  ,           294     ,   10  ,
            1984    ,   11  ,           1903    ,   11  ,
            1900    ,   11  ,           1633    ,   11  ,
            1540    ,   11  ,           1394    ,   11  ,
            1361    ,   11  ,           1130    ,   11  ,
            628     ,   11  ,           3879    ,   12  ,
            3876    ,   12  ,           3803    ,   12  ,
            3214    ,   12  ,           3083    ,   12  ,
            3082    ,   12  ,           2787    ,   12  ,
            2262    ,   12  ,           1168    ,   12  ,
            1173    ,   12  ,           7961    ,   13  ,
            7605    ,   13  ,           9       ,   4   ,
            16      ,   5   ,           41      ,   6   ,
            98      ,   7   ,           243     ,   8   ,
            173     ,   8   ,           485     ,   9   ,
            377     ,   9   ,           156     ,   9   ,
            945     ,   10  ,           686     ,   10  ,
            295     ,   10  ,           1902    ,   11  ,
            1392    ,   11  ,           629     ,   11  ,
            3877    ,   12  ,           3776    ,   12  ,
            2720    ,   12  ,           2263    ,   12  ,
            7756    ,   13  ,           8       ,   5   ,
            99      ,   7   ,           175     ,   8   ,
            379     ,   9   ,           947     ,   10  ,
            2013    ,   11  ,           1600    ,   11  ,
            3981    ,   12  ,           3009    ,   12  ,
            1169    ,   12  ,           40      ,   6   ,
            195     ,   8   ,           337     ,   9   ,
            673     ,   10  ,           1395    ,   11  ,
            3779    ,   12  ,           7989    ,   13  ,
            101     ,   7   ,           474     ,   9   ,
            687     ,   10  ,           631     ,   11  ,
            2249    ,   12  ,           6017    ,   13  ,
            37      ,   7   ,           280     ,   9   ,
            1606    ,   11  ,           2726    ,   12  ,
            6016    ,   13  ,           201     ,   8   ,
            801     ,   10  ,           3995    ,   12  ,
            6430    ,   13  ,           72      ,   8   ,
            1996    ,   11  ,           2721    ,   12  ,
            384     ,   9   ,           1125    ,   11  ,
            6405    ,   13  ,           994     ,   10  ,
            3777    ,   12  ,           15515   ,   14  ,
            756     ,   10  ,           2248    ,   12  ,
            1985    ,   11  ,           2344    ,   13  ,
            1505    ,   11  ,           12813   ,   14  ,
            3778    ,   12  ,           25624   ,   15  ,
            7988    ,   13  ,           120     ,   7   ,
            341     ,   9   ,           1362    ,   11  ,
            6431    ,   13  ,           250     ,   8   ,
            2012    ,   11  ,           6407    ,   13  ,
            172     ,   8   ,           585     ,   11  ,
            5041    ,   14  ,           502     ,   9   ,
            2786    ,   12  ,           476     ,   9   ,
            1261    ,   12  ,           388     ,   9   ,
            6404    ,   13  ,           342     ,   9   ,
            2521    ,   13  ,           999     ,   10  ,
            2345    ,   13  ,           946     ,   10  ,
            15208   ,   14  ,           757     ,   10  ,
            5040    ,   14  ,           802     ,   10  ,
            15209   ,   14  ,           564     ,   10  ,
            31029   ,   15  ,           1991    ,   11  ,
            51251   ,   16  ,           1632    ,   11  ,
            31028   ,   15  ,           587     ,   11  ,
            51250   ,   16  ,           2727    ,   12  ,
            7960    ,   13
};

extern const Ipp32u LowMotionInterTableVLC[149*2]=
{
/*ESCAPE*/  13   ,   9   ,            4    ,   3   ,
            20   ,   5   ,            23   ,   7   ,
            127  ,   8   ,            340  ,   9   ,
            498  ,   10  ,            191  ,   11  ,
            101  ,   12  ,            2730 ,   12  ,
            1584 ,   13  ,            5527 ,   13  ,
            951  ,   14  ,            11042,   14  ,
            3046 ,   15  ,            11   ,   4   ,
            55   ,   7   ,            98   ,   9   ,
            7    ,   11  ,            358  ,   12  ,
            206  ,   13  ,            5520 ,   13  ,
            1526 ,   14  ,            3047 ,   15  ,
            7    ,   5   ,            109  ,   8   ,
            3    ,   11  ,            799  ,   12  ,
            1522 ,   14  ,            2    ,   6   ,
            97   ,   9   ,            85   ,   12  ,
            479  ,   14  ,            26   ,   6   ,
            30   ,   10  ,            2761 ,   12  ,
            11043,   14  ,            30   ,   6   ,
            31   ,   10  ,            2755 ,   12  ,
            11051,   14  ,            6    ,   7   ,
            4    ,   11  ,            760  ,   13  ,
            25   ,   7   ,            6    ,   11  ,
            1597 ,   13  ,            87   ,   7   ,
            386  ,   11  ,            10914,   14  ,
            4    ,   8   ,            384  ,   11  ,
            1436 ,   14  ,            125  ,   8   ,
            356  ,   12  ,            1901 ,   15  ,
            2    ,   9   ,            397  ,   11  ,
            5505 ,   13  ,            173  ,   8   ,
            96   ,   12  ,            3175 ,   14  ,
            28   ,   9   ,            238  ,   13  ,
            3    ,   9   ,            719  ,   13  ,
            217  ,   9   ,            5504 ,   13  ,
            2    ,   11  ,            387  ,   11  ,
            87   ,   12  ,            97   ,   12  ,
            49   ,   11  ,            102  ,   12  ,
            1585 ,   13  ,            1586 ,   13  ,
            172  ,   13  ,            797  ,   12  ,
            118  ,   12  ,            58   ,   11  ,
            357  ,   12  ,            3174 ,   14  ,
            3    ,   2   ,            84   ,   7   ,
            683  ,   10  ,            22   ,   13  ,
            1527 ,   14  ,            5    ,   4   ,
            248  ,   9   ,            2729 ,   12  ,
            95   ,   15  ,            4    ,   4   ,
            28   ,   10  ,            5456 ,   13  ,
            4    ,   5   ,            119  ,   11  ,
            1900 ,   15  ,            14   ,   5   ,
            10   ,   12  ,            12   ,   5   ,
            1378 ,   11  ,            4    ,   6   ,
            796  ,   12  ,            6    ,   6   ,
            200  ,   13  ,            13   ,   6   ,
            474  ,   13  ,            7    ,   6   ,
            201  ,   13  ,            1    ,   7   ,
            46   ,   14  ,            20   ,   7   ,
            5526 ,   13  ,            10   ,   7   ,
            2754 ,   12  ,            22   ,   7   ,
            347  ,   14  ,            21   ,   7   ,
            346  ,   14  ,            15   ,   8   ,
            94   ,   15  ,            126  ,   8   ,
            171  ,   8   ,            45   ,   9   ,
            216  ,   9   ,            11   ,   9   ,
            20   ,   10  ,            691  ,   10  ,
            499  ,   10  ,            58   ,   10  ,
            0    ,   10  ,            88   ,   10  ,
            46   ,   9   ,            94   ,   10  ,
            1379 ,   11  ,            236  ,   12  ,
            84   ,   12  ,            2753 ,   12  ,
            5462 ,   13  ,            762  ,   13  ,
            385  ,   11  ,            5463 ,   13  ,
            1437 ,   14  ,            10915,   14  ,
            11050,   14  ,            478  ,   14  ,
            1596 ,   13  ,            207  ,   13  ,
            5524 ,   13
};
extern const Ipp32u HighMotionInterTableVLC[169*2]=
{
/*ESCAPE*/  361   ,   9   ,            0     ,   3   ,
            3     ,   4   ,            11    ,   5   ,
            20    ,   6   ,            63    ,   6   ,
            93    ,   7   ,            162   ,   8   ,
            172   ,   9   ,            366   ,   9   ,
            522   ,   10  ,            738   ,   10  ,
            1074  ,   11  ,            1481  ,   11  ,
            2087  ,   12  ,            2900  ,   12  ,
            1254  ,   13  ,            4191  ,   13  ,
            5930  ,   13  ,            8370  ,   14  ,
            11598 ,   14  ,            14832 ,   14  ,
            16757 ,   15  ,            23198 ,   15  ,
            4     ,   4   ,            30    ,   5   ,
            66    ,   7   ,            182   ,   8   ,
            371   ,   9   ,            917   ,   10  ,
            1838  ,   11  ,            2964  ,   12  ,
            5796  ,   13  ,            8371  ,   14  ,
            11845 ,   14  ,            5     ,   5   ,
            64    ,   7   ,            73    ,   9   ,
            655   ,   10  ,            1483  ,   11  ,
            1162  ,   13  ,            2525  ,   14  ,
            29666 ,   15  ,            24    ,   5   ,
            37    ,   8   ,            138   ,   10  ,
            1307  ,   11  ,            3679  ,   12  ,
            2505  ,   14  ,            5020  ,   15  ,
            41    ,   6   ,            79    ,   9   ,
            1042  ,   11  ,            1165  ,   13  ,
            11841 ,   14  ,            56    ,   6   ,
            270   ,   9   ,            1448  ,   11  ,
            4188  ,   13  ,            14834 ,   14  ,
            88    ,   7   ,            543   ,   10  ,
            3710  ,   12  ,            14847 ,   14  ,
            35    ,   8   ,            739   ,   10  ,
            1253  ,   13  ,            11840 ,   14  ,
            161   ,   8   ,            1470  ,   11  ,
            2504  ,   14  ,            131   ,   8   ,
            314   ,   11  ,            5921  ,   13  ,
            68    ,   9   ,            630   ,   12  ,
            14838 ,   14  ,            139   ,   10  ,
            1263  ,   13  ,            23195 ,   15  ,
            520   ,   10  ,            7422  ,   13  ,
            921   ,   10  ,            7348  ,   13  ,
            926   ,   10  ,            14835 ,   14  ,
            1451  ,   11  ,            29667 ,   15  ,
            1847  ,   11  ,            23199 ,   15  ,
            2093  ,   12  ,            3689  ,   12  ,
            3688  ,   12  ,            1075  ,   11  ,
            2939  ,   12  ,            11768 ,   14  ,
            11862 ,   14  ,            11863 ,   14  ,
            14839 ,   14  ,            20901 ,   15  ,
            3     ,   3   ,            42    ,   6   ,
            228   ,   8   ,            654   ,   10  ,
            1845  ,   11  ,            4184  ,   13  ,
            7418  ,   13  ,            11769 ,   14  ,
            16756 ,   15  ,            9     ,   4   ,
            84    ,   8   ,            920   ,   10  ,
            1163  ,   13  ,            5021  ,   15  ,
            13    ,   4   ,            173   ,   9   ,
            2086  ,   12  ,            11596 ,   14  ,
            17    ,   5   ,            363   ,   9   ,
            2943  ,   12  ,            20900 ,   15  ,
            25    ,   5   ,            539   ,   10  ,
            5885  ,   13  ,            29    ,   5   ,
            916   ,   10  ,            10451 ,   14  ,
            43    ,   6   ,            1468  ,   11  ,
            23194 ,   15  ,            47    ,   6   ,
            583   ,   12  ,            16    ,   7   ,
            2613  ,   12  ,            62    ,   6   ,
            2938  ,   12  ,            89    ,   7   ,
            4190  ,   13  ,            38    ,   8   ,
            2511  ,   14  ,            85    ,   8   ,
            7349  ,   13  ,            87    ,   8   ,
            3675  ,   12  ,            160   ,   8   ,
            5224  ,   13  ,            368   ,   9   ,
            144   ,   10  ,            462   ,   9   ,
            538   ,   10  ,            536   ,   10  ,
            360   ,   9   ,            542   ,   10  ,
            580   ,   12  ,            1846  ,   11  ,
            312   ,   11  ,            1305  ,   11  ,
            3678  ,   12  ,            1836  ,   11  ,
            2901  ,   12  ,            2524  ,   14  ,
            8379  ,   14  ,            1164  ,   13  ,
            5923  ,   13  ,            11844 ,   14  ,
            5797  ,   13  ,            1304  ,   11  ,
            14846 ,   14
};
extern const Ipp32u MidRateInterTableVLC[103*2]=
{
/*ESCAPE*/  3   ,   7   ,            2   ,   2   ,
            15  ,   4   ,            21  ,   6   ,
            23  ,   7   ,            31  ,   8   ,
            37  ,   9   ,            36  ,   9   ,
            33  ,   10  ,            32  ,   10  ,
            7   ,   11  ,            6   ,   11  ,
            32  ,   11  ,            6   ,   3   ,
            20  ,   6   ,            30  ,   8   ,
            15  ,   10  ,            33  ,   11  ,
            80  ,   12  ,            14  ,   4   ,
            29  ,   8   ,            14  ,   10  ,
            81  ,   12  ,            13  ,   5   ,
            35  ,   9   ,            13  ,   10  ,
            12  ,   5   ,            34  ,   9   ,
            82  ,   12  ,            11  ,   5   ,
            12  ,   10  ,            83  ,   12  ,
            19  ,   6   ,            11  ,   10  ,
            84  ,   12  ,            18  ,   6   ,
            10  ,   10  ,            17  ,   6   ,
            9   ,   10  ,            16  ,   6   ,
            8   ,   10  ,            22  ,   7   ,
            85  ,   12  ,            21  ,   7   ,
            20  ,   7   ,            28  ,   8   ,
            27  ,   8   ,            33  ,   9   ,
            32  ,   9   ,            31  ,   9   ,
            30  ,   9   ,            29  ,   9   ,
            28  ,   9   ,            27  ,   9   ,
            26  ,   9   ,            34  ,   11  ,
            35  ,   11  ,            86  ,   12  ,
            87  ,   12  ,            7   ,   4   ,
            25  ,   9   ,            5   ,   11  ,
            15  ,   6   ,            4   ,   11  ,
            14  ,   6   ,            13  ,   6   ,
            12  ,   6   ,            19  ,   7   ,
            18  ,   7   ,            17  ,   7   ,
            16  ,   7   ,            26  ,   8   ,
            25  ,   8   ,            24  ,   8   ,
            23  ,   8   ,            22  ,   8   ,
            21  ,   8   ,            20  ,   8   ,
            19  ,   8   ,            24  ,   9   ,
            23  ,   9   ,            22  ,   9   ,
            21  ,   9   ,            20  ,   9   ,
            19  ,   9   ,            18  ,   9   ,
            17  ,   9   ,            7   ,   10  ,
            6   ,   10  ,            5   ,   10  ,
            4   ,   10  ,            36  ,   11  ,
            37  ,   11  ,            38  ,   11  ,
            39  ,   11  ,            88  ,   12  ,
            89  ,   12  ,            90  ,   12  ,
            91  ,   12  ,            92  ,   12  ,
            93  ,   12  ,            94  ,   12  ,
            95  ,   12
};
extern const Ipp32u HighRateInterTableVLC[175*2]=
{
/*ESCAPE*/  115     ,   7   ,            2       ,   2   ,
            0       ,   3   ,            30      ,   5   ,
            4       ,   5   ,            18      ,   6   ,
            112     ,   7   ,            26      ,   7   ,
            95      ,   8   ,            71      ,   8   ,
            467     ,   9   ,            181     ,   9   ,
            87      ,   9   ,            949     ,   10  ,
            365     ,   10  ,            354     ,   10  ,
            1998    ,   11  ,            1817    ,   11  ,
            1681    ,   11  ,            710     ,   11  ,
            342     ,   11  ,            3986    ,   12  ,
            3374    ,   12  ,            3360    ,   12  ,
            1438    ,   12  ,            1128    ,   12  ,
            678     ,   12  ,            7586    ,   13  ,
            7264    ,   13  ,            6723    ,   13  ,
            2845    ,   13  ,            2240    ,   13  ,
            1373    ,   13  ,            3       ,   3   ,
            10      ,   5   ,            119     ,   7   ,
            229     ,   8   ,            473     ,   9   ,
            997     ,   10  ,            358     ,   10  ,
            1684    ,   11  ,            338     ,   11  ,
            1439    ,   12  ,            7996    ,   13  ,
            6731    ,   13  ,            1374    ,   13  ,
            12      ,   4   ,            125     ,   7   ,
            68      ,   8   ,            992     ,   10  ,
            1897    ,   11  ,            3633    ,   12  ,
            7974    ,   13  ,            1372    ,   13  ,
            27      ,   5   ,            226     ,   8   ,
            933     ,   10  ,            713     ,   11  ,
            7971    ,   13  ,            15175   ,   14  ,
            7       ,   5   ,            472     ,   9   ,
            728     ,   11  ,            7975    ,   13  ,
            13460   ,   14  ,            53      ,   6   ,
            993     ,   10  ,            1436    ,   12  ,
            14531   ,   14  ,            12      ,   6   ,
            357     ,   10  ,            7459    ,   13  ,
            5688    ,   14  ,            104     ,   7   ,
            1683    ,   11  ,            14917   ,   14  ,
            32      ,   7   ,            3984    ,   12  ,
            31990   ,   15  ,            232     ,   8   ,
            1423    ,   12  ,            11503   ,   15  ,
            69      ,   8   ,            2874    ,   13  ,
            497     ,   9   ,            15174   ,   14  ,
            423     ,   9   ,            5750    ,   14  ,
            86      ,   9   ,            26922   ,   15  ,
            909     ,   10  ,            58121   ,   16  ,
            170     ,   10  ,            116241  ,   17  ,
            735     ,   11  ,            46009   ,   17  ,
            712     ,   11  ,            232480  ,   18  ,
            432     ,   11  ,            91024   ,   18  ,
            3999    ,   12  ,            92017   ,   18  ,
            3792    ,   12  ,            464963  ,   19  ,
            3370    ,   12  ,            1023628 ,   20  ,
            1121    ,   12  ,            1023630 ,   20  ,
            2919    ,   13  ,            1375    ,   13  ,
            63      ,   6   ,            109     ,   9   ,
            3728    ,   12  ,            1358    ,   13  ,
            19      ,   6   ,            281     ,   10  ,
            2918    ,   13  ,            11      ,   6   ,
            565     ,   11  ,            31989   ,   15  ,
            117     ,   7   ,            3364    ,   12  ,
            63977   ,   16  ,            46      ,   7   ,
            7970    ,   13  ,            33      ,   7   ,
            1359    ,   13  ,            20      ,   7   ,
            14916   ,   14  ,            228     ,   8   ,
            31991   ,   15  ,            94      ,   8   ,
            29061   ,   15  ,            55      ,   8   ,
            11379   ,   15  ,            475     ,   9   ,
            23005   ,   16  ,            455     ,   9   ,
            26923   ,   15  ,            422     ,   9   ,
            22757   ,   16  ,            180     ,   9   ,
            127952  ,   17  ,            176     ,   9   ,
            45513   ,   17  ,            998     ,   10  ,
            92016   ,   18  ,            366     ,   10  ,
            255906  ,   18  ,            283     ,   10  ,
            1023629 ,   20  ,            217     ,   10  ,
            1023631 ,   20  ,            168     ,   10  ,
            182051  ,   19  ,            1865    ,   11  ,
            929924  ,   20  ,            1686    ,   11  ,
            364101  ,   20  ,            734     ,   11  ,
            728200  ,   21  ,            561     ,   11  ,
            1859850 ,   21  ,            433     ,   11  ,
            7439405 ,   23  ,            3371    ,   12  ,
            3719703 ,   22  ,            3375    ,   12  ,
            1456403 ,   22  ,            1458    ,   12  ,
            1456402 ,   22  ,            1129    ,   12  ,
            7439404 ,   23  ,            6722    ,   13  ,
            2241    ,   13
};

extern const Ipp8u Mode3SizeConservativeVLC[12*2] =
{
     0, 0 ,         1, 3,
     2, 3,          3, 3,
     4, 3 ,         5, 3,
     6, 3,          7, 3,
     0, 5 ,         1, 5,
     2, 5,          3, 5
};
extern const Ipp8u Mode3SizeEfficientVLC[12*2] =
{
     0, 0 ,     0, 0,
     1, 1,      1, 2,
     1, 3 ,     1, 4,
     1, 5,      1, 6,
     0, 6 ,     0, 0,
     0, 0,      0, 0
};

extern const Ipp8u  frameTypeCodesVLC[2][2*4] = {
{
   /*code, size*/
   0,       1,  /*I  frame*/
   1,       1,  /*P  frame*/
   0,       0,  /*BI  frame */
   0,       0,  /*B   frame */
},
{
   1,       2,  /*I  frame*/
   1,       1,  /*P  frame*/
   0,       2,  /*BI  frame */
   0,       2   /*B   frame */
}
};
extern const Ipp8u  MVRangeCodesVLC[4*2] =
{
   /*code, size*/
    0,  0,
    2,  2,
    6,  3,
    7,  3
};

extern const Ipp8u ACTableCodesVLC[3*2]=
{
    0,  1,
    2,  2,
    3,  2
};
extern const Ipp8u DCQuantValues[32] =
{
    0,  2,  4,  8,  8,  8,  9,  9,
    10, 10, 11, 11, 12, 12, 13, 13,
    14, 14, 15, 15, 16, 16, 17, 17,
    18, 18, 19, 19, 20, 20, 21, 21
};
extern const Ipp8u quantValue[32] =
{
    0xFF,
    1,  2,  3,  4,  5,  6,  7,  8,
    6,  7,  8,  9,  10, 11, 12, 13,
    14, 15, 16, 17, 18, 19, 20, 21,
    22, 23, 24, 25, 27, 29, 31
};

extern const Ipp8u LowMotionIntraDeltaLevelLast0[21] =
{
    16,     11,     8,      7,      5,      4,      4,
    3,      3,      3,      3,      3,      3,      3,
    2,      2,      1,      1,      1,      1,      1
};

extern const Ipp8u LowMotionIntraDeltaLevelLast1[27] =
{
    4,      4,      3,      3,      2,      2,      2,
    2,      2,      2,      2,      2,      2,      2,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1
};

extern const Ipp8u LowMotionIntraDeltaRunLast0[16+1] =
{
    0,      20,     15,     13,     6,      4,      3,
    3,      2,      1,      1,      1,      0,      0,
    0,      0,      0
};
extern const Ipp8u LowMotionIntraDeltaRunLast1[4+1] =
{
    0,     26,     13,      3,      1
};

extern const Ipp8u HighMotionIntraDeltaLevelLast0[31] =
{
    19,     15,     12,     11,     6,      5,      4,
    4,      4,      4,      3,      3,      3,      3,
    3,      3,      2,      2,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1
};

extern const Ipp8u HighMotionIntraDeltaLevelLast1[38] =
{
    6,      5,      4,      4,      3,      2,      2,
    2,      2,      2,      2,      2,      2,      2,
    2,      2,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1
};


extern const Ipp8u HighMotionIntraDeltaRunLast0[20] =
{
    0,      30,     17,     15,     9,      5,      4,
    3,      3,      3,      3,      3,      2,      1,
    1,      1,      0,      0,      0,      0
};


extern const Ipp8u HighMotionIntraDeltaRunLast1[7] =
{
    0,      37,     15,     4,      3,      1,      0
};
extern const Ipp8u MidRateIntraDeltaLevelLast0[15] =
{
    27,     10,     5,      4,      3,      3,      3,
     3,     2,      2,      1,      1,      1,      1,
     1
};

extern const Ipp8u MidRateIntraDeltaLevelLast1[21] =
{
    8,      3,      2,      2,      2,      2,      2,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1
};

extern const Ipp8u MidRateIntraDeltaRunLast0[28] =
{
    0,      14,     9,      7,      3,      2,      1,
    1,      1,      1,      1,      0,      0,      0,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0,      0,      0,      0,      0
};

extern const Ipp8u MidRateIntraDeltaRunLast1[9] =
{
    0,      20,     6,      1,      0,      0,      0,
    0,      0
};
extern const Ipp8u HighRateIntraDeltaLevelLast0[15] =
{
    56,     20,     10,     7,      6,      5,      4,
    3,      3,      3,      2,      2,      2,      2,
    1
};

extern const Ipp8u HighRateIntraDeltaLevelLast1[17] =
{
    4,      3,      3,      2,      2,      2,      2,
    2,      2,      2,      2,      2,      2,      2,
    2,      1,      1

};


extern const Ipp8u HighRateIntraDeltaRunLast0[57] =
{
    0,      14,     13,     9,      6,      5,      4,
    3,      2,      2,      2,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0,      0,      0,      0,      0,
    0
};
extern const Ipp8u HighRateIntraDeltaRunLast1[5] =
{
    0,     16,      14,     2,      0
};


extern const Ipp8u  HighMotionInterDeltaLevelLast0[27] =
{
    23,     11,     8,      7,      5,      5,      4,
     4,     3,      3,      3,      3,      2,      2,
     2,     2,      2,      1,      1,      1,      1,
     1,     1,      1,      1,      1,      1
};

extern const Ipp8u  HighMotionInterDeltaLevelLast1[37] =
{
    9,      5,      4,      4,      3,      3,      3,
    2,      2,      2,      2,      2,      2,      2,
    2,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1
};


extern const Ipp8u HighMotionInterDeltaRunLast0[24] =
{
    0,      26,     16,     11,     7,      5,      3,
    3,      2,      1,      1,      1,      0,      0,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0
};

extern const Ipp8u HighMotionInterDeltaRunLast1[10] =
{
    0,      36,     14,     6,      3,      1,      0,
    0,      0,      0
};
extern const Ipp8u LowMotionInterDeltaLevelLast0[30] =
{
    14,     9,      5,      4,      4,      4,      3,
    3,      3,      3,      3,      3,      3,      2,
    2,      2,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1
};

extern const Ipp8u LowMotionInterDeltaLevelLast1[44] =
{
    5,      4,      3,      3,      2,      2,      2,
    2,      2,      2,      2,      2,      2,      2,
    2,      2,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1

};

extern const Ipp8u LowMotionInterDeltaRunLast0[15] =
{
    0,      29,     15,     12,     5,      2,      1,
    1,      1,      1,      0,      0,      0,      0,
    0
};

extern const Ipp8u LowMotionInterDeltaRunLast1[6] =
{
    0,      43,     15,     3,      1,    0
};
extern const Ipp8u  MidRateInterDeltaLevelLast0[27] =
{
    12,     6,      4,      3,      3,      3,      3,
    2,      2,      2,      2,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1
};

extern const Ipp8u  MidRateInterDeltaLevelLast1[41] =
{
    3,      2,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1,      1,
    1,      1,      1,      1,      1,      1
};


extern const Ipp8u  MidRateInterDeltaRunLast0[13] =
{
    0,      26,     10,     6,      2,     1,       1,
    0,      0,      0,      0,      0,     0
};


extern const Ipp8u   MidRateInterDeltaRunLast1[4] =
{
    0,      40,     1,      0
};
extern const Ipp8u   HighRateInterDeltaLevelLast0[25] =
{
    32,     13,     8,      6,      5,      4,
    4,      3,      3,      3,      2,      2,
    2,      2,      2,      2,      2,      2,
    2,      2,      2,      2,      2,      1,
    1

};
extern const Ipp8u   HighRateInterDeltaLevelLast1[31] =
{
    4,      3,      3,      3,      2,      2,      2,
    2,      2,      2,      2,      2,      2,      2,
    2,      2,      2,      2,      2,      2,      2,
    2,      2,      2,      2,      2,      2,      2,
    2,      1,      1
};



extern const Ipp8u   HighRateInterDeltaRunLast0[33] =
{
    0,      24,     22,     9,      6,      4,      3,
    2,      2,      1,      1,      1,      1,      1,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0,      0,      0,      0,      0,
    0,      0,      0,      0,      0
};

extern const Ipp8u   HighRateInterDeltaRunLast1[5] =
{
    0,     30,      28,     3,      0
};

extern const sACTablesSet ACTablesSet[8] = {

    {
        HighMotionIntraDeltaLevelLast0, HighMotionIntraDeltaRunLast0,   HighMotionIntraIndexLevelLast0,
        HighMotionIntraDeltaLevelLast1, HighMotionIntraDeltaRunLast1,   HighMotionIntraIndexLevelLast1,
        HighMotionIntraTableVLC
    },
    {
        LowMotionIntraDeltaLevelLast0,  LowMotionIntraDeltaRunLast0,    LowMotionIntraIndexLevelLast0,
        LowMotionIntraDeltaLevelLast1,  LowMotionIntraDeltaRunLast1,    LowMotionIntraIndexLevelLast1,
        LowMotionIntraTableVLC
    },
    {
        MidRateIntraDeltaLevelLast0 ,  MidRateIntraDeltaRunLast0,      MidRateIntraIndexLevelLast0,
        MidRateIntraDeltaLevelLast1 ,  MidRateIntraDeltaRunLast1,      MidRateIntraIndexLevelLast1,
        MidRateIntraTableVLC
    },
    {
        HighRateIntraDeltaLevelLast0,  HighRateIntraDeltaRunLast0,     HighRateIntraIndexLevelLast0,
        HighRateIntraDeltaLevelLast1,  HighRateIntraDeltaRunLast1,     HighRateIntraIndexLevelLast1,
        HighRateIntraTableVLC
    },
    {
        HighMotionInterDeltaLevelLast0, HighMotionInterDeltaRunLast0,   HighMotionInterIndexLevelLast0,
        HighMotionInterDeltaLevelLast1, HighMotionInterDeltaRunLast1,   HighMotionInterIndexLevelLast1,
        HighMotionInterTableVLC
    },
    {
        LowMotionInterDeltaLevelLast0,  LowMotionInterDeltaRunLast0,    LowMotionInterIndexLevelLast0,
        LowMotionInterDeltaLevelLast1,  LowMotionInterDeltaRunLast1,    LowMotionInterIndexLevelLast1,
        LowMotionInterTableVLC
    },
    {
        MidRateInterDeltaLevelLast0 ,  MidRateInterDeltaRunLast0,      MidRateInterIndexLevelLast0,
        MidRateInterDeltaLevelLast1 ,  MidRateInterDeltaRunLast1,      MidRateInterIndexLevelLast1,
        MidRateInterTableVLC
    },
    {
        HighRateInterDeltaLevelLast0,  HighRateInterDeltaRunLast0,     HighRateInterIndexLevelLast0,
        HighRateInterDeltaLevelLast1,  HighRateInterDeltaRunLast1,     HighRateInterIndexLevelLast1,
        HighRateInterTableVLC
    }
};
extern const Ipp32u* DCTables[2][2] =
{
    { DCLumaLowMotionEncTableVLC,  DCChromaLowMotionEncTableVLC},
    { DCLumaHighMotionEncTableVLC, DCCromaHighMotionEncTableVLC}
};


extern const Ipp8u HorPrediction[64]=
{
    1,  1,  1,  1,  1,  1,  1,  1,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0
};
extern const Ipp8u VerPrediction[64]=
{
    1,  0,  0,  0,  0,  0,  0,  0,
    1,  0,  0,  0,  0,  0,  0,  0,
    1,  0,  0,  0,  0,  0,  0,  0,
    1,  0,  0,  0,  0,  0,  0,  0,
    1,  0,  0,  0,  0,  0,  0,  0,
    1,  0,  0,  0,  0,  0,  0,  0,
    1,  0,  0,  0,  0,  0,  0,  0,
    1,  0,  0,  0,  0,  0,  0,  0
};
extern const Ipp8u NonPrediction[64]=
{
    1,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0

};


extern const Ipp8u MVModeP [4][4*2] =
{
    {1,1,               1,2,            1,3,            0,4         }, //PQANT >12
    {0,4,               1,1,            1,3,            1,2         }, //PQANT <=12
    {(1<<1)+1,1+4,   (1<<2)+1,2+4,    (1<<3)+1,3+4,    (1<<3)+0,3+4 }, //PQANT >12  , INTENSITY
    {(1<<3)+0,3+4,   (1<<1)+1,1+4,    (1<<3)+1,3+4,    (1<<2)+1,2+4 } //PQANT <=12 , INTENSITY
};
extern const Ipp8u MVModeBField [2][4*2] =
{
    {1,1,               1,2,            1,3,            0,3         }, //PQANT >12
    {0,3,               1,1,            1,3,            1,2         } //PQANT <=12
};
extern const Ipp16u Bitplane6TableVLC[64*2] =
{
       1,  1,       2,   4,       3,   4,       0,   8,       4,   4,       1,   8,       2,   8,       71, 10,
       5,  4,       3,   8,       4,   8,       75, 10,       5,   8,       77, 10,       78, 10,       782,13,
       6,  4,       6,   8,       7,   8,       83, 10,       8,   8,       85, 10,       86, 10,       781,13,
       9,  8,       89, 10,       90, 10,       780,13,       92, 10,       779,13,       778,13,       55,  9,
       7,  4,       10,  8,       11,  8,       67, 10,       12,  8,       69, 10,       70, 10,       777,13,
       13, 8,       73, 10,       74, 10,       776,13,       76, 10,       775,13,       774,13,       54,  9,
       14, 8,       81, 10,       82, 10,       773,13,       84, 10,       772,13,       771,13,       53,  9,
       88,10,       770,13,       769,13,       52,  9,       768,13,       51,  9,       50,  9,       7,   6
};

extern const Ipp8u QuantProfileTableVLC[12*2] =
{
    0,                        1,         //        VC1_ENC_QUANT_SINGLE,
    (1<<(2+1))+(3<<1)+0,      2+1+1,       //        VC1_ENC_QUANT_MB_ANY,
    (1<<(2+1))+(3<<1)+1,      2+1+1,       //        VC1_ENC_QUANT_MB_PAIR,
    (1<<(2  ))+0,             2+1,         //        VC1_ENC_QUANT_EDGE_ALL,
    (1<<(2+2))+(2<<2)+0,      2+2+1,       //        VC1_ENC_QUANT_EDGE_LEFT,
    (1<<(2+2))+(2<<2)+1,      2+2+1,       //        VC1_ENC_QUANT_EDGE_TOP,
    (1<<(2+2))+(2<<2)+2,      2+2+1,       //        VC1_ENC_QUANT_EDGE_RIGHT,
    (1<<(2+2))+(2<<2)+3,      2+2+1,       //        VC1_ENC_QUANT_EDGE_BOTTOM,
    (1<<(2+2))+(1<<2)+0,      2+2+1,       //        VC1_ENC_QUANT_EDGES_LEFT_TOP,
    (1<<(2+2))+(1<<2)+1,      2+2+1,       //        VC1_ENC_QUANT_EDGES_TOP_RIGHT,
    (1<<(2+2))+(1<<2)+2,      2+2+1,       //        VC1_ENC_QUANT_EDGES_RIGHT_BOTTOM,
    (1<<(2+2))+(1<<2)+3,      2+2+1        //        VC1_ENC_QUANT_EDGSE_BOTTOM_LEFT,
};

extern Ipp16u MVDiffTableVLC0[73*2] =
{
    0,   6,       2,   7,       3,   7,       8,   8,
    576, 14,      3,   6,       2,   5,       6,   6,
    5,   7,       577, 14,      578, 14,      7,   6,
    8,   6,       9,   6,       40,  8,       19,  9,
    37,  10,      82,  9,       21,  7,       22,  7,
    23,  7,       579, 14,      580, 14,      166, 10,
    96,  9,       167, 10,      49,  8,       194, 10,
    195, 10,      581, 14,      582, 14,      583, 14,
    292, 13,      293, 13,      294, 13,      13,  6,
    2,   3,       7,   5,       24,  6,       50,  8,
    102, 9,       295, 13,      13,  5,       7,   4,
    8,   4,       18,  5,       50,  7,       103, 9,
    38,  6,       20,  5,       21,  5,       22,  5,
    39,  6,       204, 9,       103, 8,       23,  5,
    24,  5,       25,  5,       104, 7,       410, 10,
    105, 7,       106, 7,       107, 7,       108, 7,
    109, 7,       220, 8,       411, 10,      442, 9,
    222, 8,       443, 9,       446, 9,       447, 9,
    7, 3
};

extern const Ipp16u MVDiffTableVLC1[73*2] =
{
    0,    5,       4,    7,       5,    7,       3,   6,
    4,    6,       3,    5,       4,    5,       5,    6,
    20,   7,       6,    5,       21,   7,       44,   8,
    45,   8,       46,   8,       3008, 14,      95,   9,
    112,  9,       113,  9,       57,   8,       3009, 14,
    3010, 14,      116,  9,       117,  9,       3011, 14,
    118,  9,       3012, 14,      3013, 14,      3014, 14,
    3015, 14,      3016, 14,      3017, 14,      3018, 14,
    3019, 14,      3020, 14,      3021, 14,      3022, 14,
    1,    2,       4,    3,       15,   6,       160,  8,
    161,  8,       41,   6,       6,    3,       11,   4,
    42,   6,       162,  8,       43,   6,       119,  9,
    56,   6,       57,   6,       58,   6,       163,  8,
    236,  8,       237,  8,       3023, 14,      119,  7,
    120,  7,       242,  8,       122,  7,       486,  9,
    1512, 13,      487,  9,       246,  8,       494,  9, //
    1513, 13,      495,  9,       1514, 13,      1515, 13,
    1516, 13,      1517, 13,      1518, 13,      1519, 13,
    31, 5
};

extern const Ipp16u MVDiffTableVLC2[73*2] =
{
    0,   3,       512, 12,        513, 12,        514, 12,
    515, 12,      2,   3,         3,   4,         258, 11,
    259, 11,      260, 11,        261, 11,        262, 11,
    263, 11,      264, 11,        265, 11,        266, 11,
    267, 11,      268, 11,        269, 11,        270, 11,
    271, 11,      272, 11,        273, 11,        274, 11,
    275, 11,      276, 11,        277, 11,        278, 11,
    279, 11,      280, 11,        281, 11,        282, 11,
    283, 11,      284, 11,        285, 11,        286, 11,
    1,   1,       5,   5,         287, 11,        288, 11,
    289, 11,      290, 11,        6,   4,         7,   4,
    291, 11,      292, 11,        293, 11,        294, 11,
    295, 11,      296, 11,        297, 11,        298, 11,
    299, 11,      300, 11,        301, 11,        302, 11,
    303, 11,      304, 11,        305, 11,        306, 11,
    307, 11,      308, 11,        309, 11,        310, 11,
    311, 11,      312, 11,        313, 11,        314, 11,
    315, 11,      316, 11,        317, 11,        318, 11,
    319, 11
};

extern const Ipp16u MVDiffTableVLC3[73*2] =
{
    0,   15,      1,   11,      1,   15,      2,   15,
    3,   15,      4,   15,      1,   12,      5,   15,
    4,   12,      3,   11,      5,   12,      8,   12,
    6,   15,      9,   12,      10,  12,      11,  12,
    12,  12,      7,   15,      104, 15,      14,  12,
    105, 15,      4,   10,      10,  11,      15,  12,
    11,  11,      6,   10,      14,  11,      8,   10,
    106, 15,      107, 15,      108, 15,      15,  11,
    109, 15,      9,   10,      55,  14,      10,  10,
    1,   4,       2,   4,       1,   5,       2,   7,
    3,   8,       12,  9,       6,   5,       2,   3,
    6,   4,       7,   5,       28,  6,       7,   8,
    15,  5,       8,   4,       5,   3,       18,  5,
    29,  6,       152, 8,       77,  7,       24,  5,
    25,  5,       26,  5,       39,  6,       108, 7,
    13,  9,       109, 7,       55,  6,       56,  6,
    57,  6,       116, 7,       11,  10,      153, 8,
    234, 8,       235, 8,       118, 7,       119, 7,
    15,  4
};

extern const Ipp8u MVSizeOffset[VC1_ENC_MV_LIMIT*3]=
{
/*index   offset    size*/
    0   ,   0   ,   0   ,
    1   ,   1   ,   2   ,
    1   ,   1   ,   2   ,
    2   ,   3   ,   3   ,
    2   ,   3   ,   3   ,
    2   ,   3   ,   3   ,
    2   ,   3   ,   3   ,
    3   ,   7   ,   4   ,
    3   ,   7   ,   4   ,
    3   ,   7   ,   4   ,
    3   ,   7   ,   4   ,
    3   ,   7   ,   4   ,
    3   ,   7   ,   4   ,
    3   ,   7   ,   4   ,
    3   ,   7   ,   4   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    4   ,   15  ,   5   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8   ,
    5   ,   31  ,   8
};

extern const Ipp8u longMVLength[4*2]=
{
 /*dx,      dy*/
    9,      8,
    10,     9,
    12,     10,
    13,     11
};
extern const Ipp16s MVRange[4*2]=
{
 /* x,      y*/
    256 /4 ,    128 /4,
    512 /4,     256 /4 ,
    2048/4,     512 /4 ,
    4096/4,     1024/4
};
extern const Ipp16s MVRangeFieldsHalf[4*2]=
{
 /* x,      y*/
    128 ,      64  ,
    256 ,      128 ,
    1024,      256 ,
    2048,      512
};
extern const Ipp16u VLCTableCBPCY_I[64*2] =
{
        1, 1 ,     23, 6 ,       9, 5 ,      5, 5 ,     6, 5 ,     71, 9 ,      32, 7 ,     16, 7 ,
        2, 5 ,    124, 9 ,      58, 7 ,     29, 7 ,     2, 6 ,    236, 9 ,     119, 8 ,      0, 8 ,
        3, 5 ,    183, 9 ,      44, 7 ,     19, 7 ,     1, 6 ,    360, 10 ,     70, 8 ,     63, 8 ,
       30, 6 ,   1810, 13 ,    181, 9 ,     66, 8 ,    34, 7 ,    453, 11 ,    286, 10 ,   135, 9 ,
        6, 4 ,      3, 9 ,      30, 7 ,     28, 6 ,    18, 7 ,    904, 12 ,     68, 9 ,    112, 9 ,
       31, 6 ,    574, 11 ,     57, 8 ,    142, 9 ,     1, 7 ,    454, 11 ,    182, 9 ,     69, 9 ,
       20, 6 ,    575, 11 ,    125, 9 ,     24, 9 ,     7, 7 ,    455, 11 ,    134, 9 ,     25, 9 ,
       21, 6 ,    475, 10 ,      2, 9 ,     70, 9 ,     13, 8 ,   1811, 13 ,    474, 10 ,   361, 10
};
extern const Ipp16u VLCTableCBPCY_PB_0 [64*2] =
{

       0,13,     6, 13,    15,  7,    13, 13,  13, 7,    11, 13,     3, 13,    13, 12,
       5, 6,     8, 13,    49,  7,    10, 12,  12, 6,   114,  8,   102,  8,   119,  8,
       1, 5,    54,  7,    96,  8,     8, 12,  10, 6,   111,  8,     5, 13,    15, 12,
      12, 7,    10, 13,     2, 13,    12, 12,  13, 6,   115,  8,    53,  7,    63,  7,
       1, 6,     7, 13,     1,  8,     7, 12,  14, 7,    12, 13,     4, 13,    14, 12,
       1, 7,     9, 13,    97,  8,    11, 12,   7, 5,    58,  7,    52,  7,    62,  7,
       4, 6,   103,  8,     1, 13,     9, 12,  11, 6,    56,  7,   101,  8,   118,  8,
       4, 5,   110,  8,   100,  8,    30,  6,   2, 3,     5,  3,     4,  3,     3,  2

};
extern const Ipp16u VLCTableCBPCY_PB_1 [64*2] =
{

       0,14,     9, 13,     1,  8,    18, 13,    5, 3,    14, 13,   237,  8,    26, 13,
       3, 3,   121,  7,     3,  8,    22, 13,    13, 4,    16, 13,     6, 13,    30, 13,
       2, 3,    10, 13,     1, 13,    20, 13,    12, 4,   241,  8,     5, 13,    28, 13,
      16, 5,    12, 13,     3, 13,    24, 13,    28, 5,   124,  7,   239,  8,   247,  8,
       1, 3,   240,  8,     1, 14,    19, 13,    18, 5,    15, 13,     4, 13,    27, 13,
       1, 4,   122,  7,     2, 13,    23, 13,     1, 6,    17, 13,     7, 13,    31, 13,
       1, 5,    11, 13,     2,  8,    21, 13,    19, 5,   246,  8,   238,  8,    29, 13,
      17, 5,    13, 13,   236,  8,    25, 13,    58, 6,    63,  6,     8, 13,   125,  7

};



extern const Ipp16u VLCTableCBPCY_PB_2 [64*2] =
{

       0,13,   201,  8,    25,  6,   231,  8,   5, 4,   221,  8,     1, 13,     3, 12,
       2, 4,   414,  9,     2,  8,   241,  8,  16, 5,   225,  8,   195,  8,   492,  9,
       2, 5,   412,  9,     1, 10,   240,  8,   7, 4,   224,  8,    98,  7,   245,  8,
       1, 6,   220,  8,    96,  7,     5, 13,   9, 4,   230,  8,   101,  7,   247,  8,
       1, 5,   102,  7,     1,  8,   415,  9,  24, 6,     3, 13,     2, 13,   244,  8,
       3, 4,    54,  6,     3,  8,   484,  9,  17, 5,   114,  7,   200,  8,   493,  9,
       3, 5,   413,  9,     1,  9,     4, 13,  13, 5,   113,  7,    99,  7,   485,  9,
       4, 4,   111,  7,   194,  8,   243,  8,   5, 3,    29,  5,    26,  5,    31,  5

};



extern const Ipp16u VLCTableCBPCY_PB_3[64*2] =
{

       0, 9,    28, 9,    12,9,    44, 9,    3, 2,    36, 9,    20,9,    52, 9,
       2, 2,    32, 9,    16,9,    48, 9,    8, 9,    40, 9,    24,9,    28, 8,
       1, 3,    30, 9,    14,9,    46, 9,    6, 9,    38, 9,    22,9,    54, 9,
       3, 9,    34, 9,    18,9,    50, 9,   10, 9,    42, 9,    26,9,    30, 8,
       1, 2,    29, 9,    13,9,    45, 9,    5, 9,    37, 9,    21,9,    53, 9,
       2, 9,    33, 9,    17,9,    49, 9,    9, 9,    41, 9,    25,9,    29, 8,
       1, 9,    31, 9,    15,9,    47, 9,    7, 9,    39, 9,    23,9,    55, 9,
       4, 9,    35, 9,    19,9,    51, 9,   11, 9,    43, 9,    27,9,    31, 8

};
extern const Ipp16u* VLCTableCBPCY_PB[4]=
{
    VLCTableCBPCY_PB_0,
    VLCTableCBPCY_PB_1,
    VLCTableCBPCY_PB_2,
    VLCTableCBPCY_PB_3
};
extern const    eCodingSet          LumaCodingSetsIntra[2][3] = {
                                     {VC1_ENC_HIGH_RATE_INTRA , VC1_ENC_HIGH_MOTION_INTRA, VC1_ENC_MID_RATE_INTRA},
                                     {VC1_ENC_LOW_MOTION_INTRA, VC1_ENC_HIGH_MOTION_INTRA, VC1_ENC_MID_RATE_INTRA}};

extern const    eCodingSet          ChromaCodingSetsIntra[2][3] = {
                                     {VC1_ENC_HIGH_RATE_INTER , VC1_ENC_HIGH_MOTION_INTER, VC1_ENC_MID_RATE_INTER},
                                     {VC1_ENC_LOW_MOTION_INTER, VC1_ENC_HIGH_MOTION_INTER, VC1_ENC_MID_RATE_INTER}};

extern const    eCodingSet          CodingSetsInter[2][3] = {
                                     {VC1_ENC_HIGH_RATE_INTER , VC1_ENC_HIGH_MOTION_INTER, VC1_ENC_MID_RATE_INTER},
                                     {VC1_ENC_LOW_MOTION_INTER, VC1_ENC_HIGH_MOTION_INTER, VC1_ENC_MID_RATE_INTER}};

extern const      Ipp16u*           MVDiffTablesVLC[4]=
{
    MVDiffTableVLC0,
    MVDiffTableVLC1,
    MVDiffTableVLC2,
    MVDiffTableVLC3
};

extern const Ipp8u    BMVTypeVLC[2][3*2]=
{
  {
   // BFraction >=1/2
   2,2,     //VC1_ENC_FORWARD
   0,1,     //VC1_ENC_BACKWARD
   3,2      //VC1_ENC_INTERPOLATED
  },
  {
    // BFraction<1/2
   0,1,     //VC1_ENC_FORWARD
   2,2,     //VC1_ENC_BACKWARD
   3,2      //VC1_ENC_INTERPOLATED
  }
};
extern const Ipp8u BFractionVLC[9][8*2] =
{
    {0,0,   0,0,       0,0,    0,0,     0,0,     0,0,     0,0,     0,0}, // ../0
    {0,0,   0,0,       0,0,    0,0,     0,0,     0,0,     0,0,     0,0}, // ../1
    {0,0,   0,3,       0,0,    0,0,     0,0,     0,0,     0,0,     0,0}, // ../2
    {0,0,   1,3,       2,3,    0,0,     0,0,     0,0,     0,0,     0,0}, // ../3
    {0,0,   3,3,       0,3,    4,3,     0,0,     0,0,     0,0,     0,0}, // ../4
    {0,0,   5,3,       6,3,    112,7,   113,7,   0,0,     0,0,     0,0}, // ../5
    {0,0,   114,7,     1,3,    0,3,     2,3,     115,7,   0,0,     0,0}, // ../6
    {0,0,   116,7,     117,7,  118,7,   119,7,   120,7,   121,7,   0,0}, // ../7
    {0,0,   122,7,     3,3,    123,7,   0,3,     124,7,   4,3,     125,7}// ../8
};
extern const Ipp8u BFractionScaleFactor[9][8] =
{

    {0,   0,       0,    0,     0,     0,     0,     0}, // ../0
    {0,   0,       0,    0,     0,     0,     0,     0}, // ../1
    {0,   128,     0,    0,     0,     0,     0,     0}, // ../2
    {0,   85,      170,  0,     0,     0,     0,     0}, // ../3
    {0,   64,      128,  192,   0,     0,     0,     0}, // ../4
    {0,   51,      102,  153,   204,   0,     0,     0}, // ../5
    {0,   43,      85,   128,   170,   215,   0,     0}, // ../6
    {0,   37,      74,   111,   148,   185,   222,   0}, // ../7
    {0,   32,      64,   96,    128,   160,   192,   224}// ../8
};
extern const  Ipp16s TTMBVLC_HighRate[2][4][3*2] =          /*PQUANT<5 */
{
    { //Block

            {  0x003, 2,     0x003, 2,       0x003, 2 }, //8x8
            {  0x02e, 6,     0x05f, 7,       0x000, 2 }, //8x4 : bottom, top,  both
            {  0x016, 5,     0x015, 5,       0x001, 2 }, //4x8 : right,  left, both
            {  0x004, 3,     0x004, 3,       0x004, 3 }  //4x4
    },
    {
        //MB
            { 0x014, 5,      0x014,5,        0x014, 5}, //8x8
            { 0x2f1,10,      0x179,9,        0x17b, 9}, //8x4 : bottom, top,  both
            { 0xbc0,12,      0xbc1,12,       0x5e1,11}, //4x8 : right,  left, both
            { 0x17a, 9,      0x17a, 9,       0x17a, 9}  //4x4
    }
};
extern const  Ipp16s TTMBVLC_MediumRate[2][4][3*2] =        /*5<=PQUANT<13 */
{
    {
    //Block
            { 0x006, 3,     0x006, 3,   0x006, 3},  //8x8
            { 0x006, 4,     0x003, 4,   0x007, 4},  //8x4 : bottom, top,  both
            { 0x00f, 4,     0x00e, 4,   0x000, 3},  //4x8 : right,  left, both
            { 0x002, 3,     0x002, 3,   0x002, 3}  //4x4
    },
    {
    //MB

            { 0x002, 2,     0x002, 2,    0x002, 2}, //8x8
            { 0x014, 7,     0x011, 7,    0x00b, 6}, //8x4 : bottom, top,  both
            { 0x009, 6,     0x021, 8,    0x015, 7}, //4x8 : right,  left, both
            { 0x020, 8,     0x020, 8,    0x020, 8}  //4x4
    }

};
extern const Ipp16s TTMBVLC_LowRate[2][4][3*2] =           /* PQUANT>=13 */
{
    {
     //Block

            { 0x006, 3,     0x006, 3,       0x006, 3}, //8x8
            { 0x000, 3,     0x00e, 4,       0x005, 5}, //8x4 : bottom, top,  both
            { 0x002, 3,     0x003, 3,       0x003, 4}, //4x8 : right,  left, both
            { 0x00f, 4,     0x00f, 4,       0x00f, 4} //4x4
    },
    {
    //MB

            { 0x002, 2,      0x002, 2,       0x002, 2}, //8x8
            { 0x081,10,      0x021, 8,       0x009, 6}, //8x4 : bottom, top,  both
            { 0x101,11,      0x041, 9,       0x011, 7}, //4x8 : right,  left, both
            { 0x100,11,      0x100,11,       0x100,11}  //4x4
    }
};
extern const Ipp8u  TTBLKVLC_HighRate[4][3*2] =                /*PQUANT<5 */
{
            { 0x03, 2,      0x03, 2,        0x03, 2}, //8x8
            { 0x11, 5,      0x10, 5,        0x00, 2}, //8x4 : bottom, top,  both
            { 0x12, 5,      0x13, 5,        0x01, 2}, //4x8 : right,  left, both
            { 0x05, 3,      0x05, 3,        0x05, 3}  //4x4

};
extern const Ipp8u  TTBLKVLC_MediumRate[4][3*2] =              /*5<=PQUANT<13 */
{
            { 0x03, 2,      0x03, 2,        0x03, 2}, //8x8
            { 0x08, 4,      0x09, 4,        0x03, 3}, //8x4 : bottom, top,  both
            { 0x00, 3,      0x01, 3,        0x05, 3}, //4x8 : right,  left, both
            { 0x02, 3,      0x02, 3,        0x02, 3}  //4x4

};
extern const Ipp8u  TTBLKVLC_LowRate[4][3*2] =      /* PQUANT>=13 */
 {
     { 0x01, 2,     0x01, 2,            0x01, 2 }, //8x8
     { 0x04, 3,     0x0b, 4,            0x0a, 4 }, //8x4 : bottom, top,  both
     { 0x06, 3,     0x07, 3,            0x00, 3 }, //4x8 : right,  left, both
     { 0x01, 3,     0x01, 3,            0x01, 3 }  //4x4
};

extern const Ipp8u SubPatternMask[4][2]=
{
    {//8x8
        0x0C, 0x03
    },
    {//8x4 : top, bottom
        0x0C, 0x03
    },
    {//4x8 : left, right
        0x0A, 0x05
    },
    {
        0x0C, 0x03
    },
};
extern const Ipp8u  SubPattern4x4VLC_HighRate[16*2] =           /*PQUANT<5 */
{
     0x00, 0 ,  0x0e, 5 ,  0x0c, 5 ,  0x07, 5 ,
     0x0b, 5 ,  0x09, 5 ,  0x1a, 6 ,  0x02, 4 ,
     0x0a, 5 ,  0x1b, 6 ,  0x08, 5 ,  0x00, 4 ,
     0x06, 5 ,  0x01, 4 ,  0x0f, 5 ,  0x01, 1
};
extern const Ipp8u  SubPattern4x4VLC_MediumRate[16*2] =        /*5<=PQUANT<13 */
{
    0x00, 0 ,  0x0e, 4 ,  0x00, 3 ,  0x08, 4 ,
    0x0f, 4 ,  0x0a, 4 ,  0x04, 5 ,  0x17, 5 ,
    0x0d, 4 ,  0x05, 5 ,  0x09, 4 ,  0x19, 5 ,
    0x03, 4 ,  0x18, 5 ,  0x16, 5 ,  0x01, 2
};
extern const Ipp8u  SubPattern4x4VLC_LowRate[16*2] =            /* PQUANT>=13 */
{

    0x00, 0 ,  0x05, 3 ,  0x06, 3 ,  0x02, 4 ,
    0x02, 3 ,  0x08, 4 ,  0x00, 5 ,  0x1c, 5 ,
    0x03, 3 ,  0x01, 5 ,  0x03, 4 ,  0x1d, 5 ,
    0x01, 4 ,  0x13, 5 ,  0x12, 5 ,  0x0f, 4
};
extern const Ipp8u  SubPattern8x4_4x8VLC[3*2] =
{
//8x4 : bottom,         top,        both
//4x8 : right,          left,       both
        0x02, 2 ,       0x03,2,     0x00,1
};

//--------------------------------------------------------------------------------------------
//VC-1 Table 234: Intra Normal Scan
//remapped as src index for continues dst index
const extern Ipp8u VC1_Intra_Normal_Scan[64] =
{
     0,     8,      1,      2,      9,      16,     24,     17,
    10,     3,      4,      11,     18,     25,     32,     40,
    33,     48,     26,     19,     12,     5,      6,      13,
    20,     27,     34,     41,     56,     49,     57,     42,
    35,     28,     21,     14,     7,      15,     22,     29,
    36,     43,     50,     58,     51,     59,     44,     37,
    30,     23,     31,     38,     45,     52,     60,     53,
    61,     46,     39,     47,     54,     62,     55,     63
};

//VC-1 Table 235: Intra Horizontal Scan
//remapped as src index for continues dst index
const extern Ipp8u VC1_Intra_Horizontal_Scan[64] =
{
      0,        1,      8,      2,      3,      9,      16,     24,
      17,       10,     4,      5,      11,     18,     25,     32,
      40,       48,     33,     26,     19,     12,     6,      7,
      13,       20,     27,     34,     41,     56,     49,     57,
      42,       35,     28,     21,     14,     15,     22,     29,
      36,       43,     50,     58,     51,     44,     37,     30,
      23,       31,     38,     45,     52,     59,     60,     53,
      46,       39,     47,     54,     61,     62,     55,     63
};

//VC-1 Table 236: Intra Vertical Scan
//remapped as src index for continues dst index
const extern Ipp8u VC1_Intra_Vertical_Scan[64] =
{
       0,       8,      16,     1,      24,     32,     40,     9,
       2,       3,      10,     17,     25,     48,     56,     41,
      33,       26,     18,     11,     4,      5,      12,     19,
      27,       34,     49,     57,     50,     42,     35,     28,
      20,       13,     6,      7,      14,     21,     29,     36,
      43,       51,     58,     59,     52,     44,     37,     30,
      22,       15,     23,     31,     38,     45,     60,     53,
      46,       39,     47,     54,     61,     62,     55,     63
};


//Table 237: Inter 8x8 Scan for Simple and Main Profiles
//and Progressive Mode in Advanced Profile
//remapped as src index for continues dst index
const extern Ipp8u VC1_Inter_8x8_Scan[64] =
{
       0,   8,     1,     2,     9,     16,    24,    17,
      10,   3,     4,     11,    18,    25,    32,    40,
      48,   56,    41,    33,    26,    19,    12,    5,
       6,   13,    20,    27,    34,    49,    57,    58,
      50,   42,    35,    28,    21,    14,    7,     15,
      22,   29,    36,    43,    51,    59,    60,    52,
      44,   37,    30,    23,    31,    38,    45,    53,
      61,   62,    54,    46,    39,    47,    55,    63
  };

//VC-1 Table 238: Inter 8x4 Scan for Simple and Main Profiles
//remapped as src index for continues dst index
const extern Ipp8u VC1_Inter_8x4_Scan[32] =
{
      0,    1,    2,    8,    3,     9,   10,   16,
      4,    11,   17,   24,   18,    12,  5,    19,
      25,   13,   20,   26,   27,    6,   21,   28,
      14,   22,   29,   7,    30,    15,  23,   31

};

//VC-1 Table 239: Inter 4x8 Scan for Simple and Main Profiles
//remapped as src index for continues dst index
const extern Ipp8u VC1_Inter_4x8_Scan[32] =
{
    0,  4,  1,  8,
    5, 12,  9,  2,
   16,  6, 13, 20,
   10, 24, 17, 14,
   28, 21, 18,  3,
   25, 29,  7, 22,
   11, 26, 15, 30,
   19, 23, 27, 31
};

//Table 240: Inter 4x4 Scan for Simple and Main Profiles and
//Progressive Mode in Advanced Profile
//remapped as src index for continues dst index
const extern Ipp8u VC1_Inter_4x4_Scan[16] =
{
    0,  4,  8,  1,
    5, 12,  9,  2,
    6, 10, 13,  3,
    7, 14, 11,  15
};

//Table 240: Progressive Mode Inter 8x4 Scan for Advanced Profile
const extern Ipp8u VC1_Inter_8x4_Scan_Adv[32] =
{
    0,    8,    1,   16,   2,   9,   10,   3,
    24,   17,   4,   11,   18,  12,  5,    19,
    25,   13,   20,  26,   27,  6,   21,   28,
    14,   22,   29,  7,    30,  15,  23,   31
};


//Table 241: Progressive Mode Inter 4x8 Scan for Advanced Profile
const extern Ipp8u VC1_Inter_4x8_Scan_Adv[32] =
{
     0,  1,  4,  2,
     5,  8,  9, 12,
     6, 16, 13, 10,
    20,  3, 17, 14,
    24,  7, 28, 21,
    18, 25, 29, 22,
    11, 26, 15, 30,
    19, 23, 27, 31
};

const extern Ipp8u VC1_Inter_InterlaceIntra_8x8_Scan_Adv[64] =
{
   0,    8,    1,    16,   24,   9,    2,   32,
   40,   48,   56,   17,   10,   3,    25,  18,
   11,   4,    33,   41,   49,   57,   26,  34,
   42,   50,   58,   19,   12,   5,    27,  20,
   13,   6,    35,   28,   21,   14,   7,   15,
   22,   29,   36,   43,   51,   59,   60,  52,
   44,   37,   30,   23,   31,   38,   45,  53,
   61,   62,   54,   46,   39,   47,   55,  63
};


/*Table 243 (SMPTE-421M-FDS1): Interlace Mode Inter 8x4 Scan for Advanced Profile*/
const extern Ipp8u VC1_Inter_Interlace_8x4_Scan_Adv[32] =
{
   0,   8,  16,  24,  1,   9,   2,   17,
   25,  10, 3,   18,  26,  4,   11,  19,
   12,  5,  13,  20,  27,  6,   21,  28,
   14,  22, 29,  7,   30,  15,  23,  31
};


/*Table 244 (SMPTE-421M-FDS1): Interlace Mode Inter 4x8 Scan for Advanced Profile*/
const extern Ipp8u VC1_Inter_Interlace_4x8_Scan_Adv[32] =
{
    0,  1,  2,  4,
    8,  5, 12,  9,
    6,  3, 16, 20,
   24, 28, 13, 10,
   17, 14, 21, 18,
   25, 29,  7, 22,
   11, 26, 15, 30,
   19, 23, 27, 31
};


/*Table 245 (SMPTE-421M-FDS1): Interlace Mode Inter 4x4 Scan for Advanced Profile*/
const extern Ipp8u VC1_Inter_Interlace_4x4_Scan_Adv[16] =
{
    0,  4,  8, 12,
    1,  5,  9,  2,
   13,  6, 10,  3,
   14,  7, 11, 15
};


const extern Ipp8u* ZagTables_I[3] =
{
    VC1_Intra_Normal_Scan,
    VC1_Intra_Vertical_Scan,
    VC1_Intra_Horizontal_Scan
};
const extern Ipp8u* ZagTables[4] =
{
   VC1_Inter_8x8_Scan,//INTER8x8
   VC1_Inter_8x4_Scan,//INTER8x4
   VC1_Inter_4x8_Scan,//INTER4x8
   VC1_Inter_4x4_Scan,//INTER4x4
};
const extern Ipp8u* ZagTables_Adv[4] =
{
   VC1_Inter_8x8_Scan    ,//INTER8x8
   VC1_Inter_8x4_Scan_Adv,//INTER8x4
   VC1_Inter_4x8_Scan_Adv,//INTER4x8
   VC1_Inter_4x4_Scan    ,//INTER4x4
};
const extern Ipp8u* ZagTables_Fields[4] =
{
   VC1_Inter_InterlaceIntra_8x8_Scan_Adv,   //INTER8x8
   VC1_Inter_Interlace_8x4_Scan_Adv,        //INTER8x4
   VC1_Inter_Interlace_4x8_Scan_Adv,        //INTER4x8
   VC1_Inter_Interlace_4x4_Scan_Adv         //INTER4x4
};
const extern eTransformType BlkTransformTypeTabl[4] =
{
    VC1_ENC_8x8_TRANSFORM,
    VC1_ENC_8x4_TRANSFORM,
    VC1_ENC_4x8_TRANSFORM,
    VC1_ENC_4x4_TRANSFORM
};
const extern Ipp8u MBTypeFieldMixedTable0_VLC[8*2] =
{
    16, 6,
    17, 6,
    3,  2,
    3,  3,
    0,  2,
    5,  4,
    9,  5,
    2,  2
};
const extern Ipp8u MBTypeFieldMixedTable1_VLC[8*2] =
{
    8,  5,
    9,  5,
    3,  3,
    6,  3,
    7,  3,
    0,  2,
    5,  4,
    2,  2
};
const extern Ipp8u MBTypeFieldMixedTable2_VLC[8*2] =
{
    16,  6,
    17,  6,
    5,   4,
    3,   3,
    0,   2,
    3,   2,
    9,   5,
    2,   2
};
const extern Ipp8u MBTypeFieldMixedTable3_VLC[8*2] =
{
    56,  6,
    57,  6,
    15,  4,
    4,   3,
    5,   3,
    6,   3,
    29,  5,
    0,   1
};
const extern Ipp8u MBTypeFieldMixedTable4_VLC[8*2] =
{
    56,  6,
    53,  6,
    27,  5,
    14,  4,
    15,  4,
    2,   2,
    12,  4,
    0,   1
};
const extern Ipp8u MBTypeFieldMixedTable5_VLC[8*2] =
{
    56,  6,
    57,  6,
    29,  5,
    5,   3,
    6,   3,
    0,   1,
    15,  4,
    4,   3
};
const extern Ipp8u MBTypeFieldMixedTable6_VLC[8*2] =
{
    16,  5,
    17,  5,
    6,   3,
    7,   3,
    0,   2,
    1,   2,
    9,   4,
    5,   3
};

const extern Ipp8u MBTypeFieldMixedTable7_VLC[8*2] =
{
    56,  6,
    57,  6,
    0,   1,
    5,   3,
    6,   3,
    29,  5,
    4,   3,
    15,  4
};
const extern Ipp8u MBTypeFieldTable0_VLC[6*2] =
{
    0,  5,
    1,  5,
    1,  1,
    1,  3,
    1,  2,
    1,  4
};
const extern Ipp8u MBTypeFieldTable1_VLC[6*2] =
{
    0,  5,
    1,  5,
    1,  1,
    1,  2,
    1,  3,
    1,  4
};
const extern Ipp8u MBTypeFieldTable2_VLC[6*2] =
{
    16,  5,
    17,  5,
    3,   2,
    0,   1,
    9,   4,
    5,   3
};
const extern Ipp8u MBTypeFieldTable3_VLC[6*2] =
{
    20,  5,
    21,  5,
    3,   2,
    11,  4,
    0,   1,
    4,   3
};
const extern Ipp8u MBTypeFieldTable4_VLC[6*2] =
{
    4,   4,
    5,   4,
    2,   2,
    3,   3,
    3,   2,
    0,   2
};
const extern Ipp8u MBTypeFieldTable5_VLC[6*2] =
{
    4,   4,
    5,   4,
    3,   3,
    2,   2,
    0,   2,
    3,   2
};
const extern Ipp8u MBTypeFieldTable6_VLC[6*2] =
{
    0,   5,
    1,   5,
    1,   3,
    1,   4,
    1,   1,
    1,   2
};
const extern Ipp8u MBTypeFieldTable7_VLC[6*2] =
{
    16,   5,
    17,   5,
    9,    4,
    5,    3,
    3,    2,
    0,    1
};

const extern Ipp8u* MBTypeFieldMixedTable_VLC[8] =
{
    MBTypeFieldMixedTable0_VLC,
    MBTypeFieldMixedTable1_VLC,
    MBTypeFieldMixedTable2_VLC,
    MBTypeFieldMixedTable3_VLC,
    MBTypeFieldMixedTable4_VLC,
    MBTypeFieldMixedTable5_VLC,
    MBTypeFieldMixedTable6_VLC,
    MBTypeFieldMixedTable7_VLC
};
const extern Ipp8u* MBTypeFieldTable_VLC[8] =
{
    MBTypeFieldTable0_VLC,
    MBTypeFieldTable1_VLC,
    MBTypeFieldTable2_VLC,
    MBTypeFieldTable3_VLC,
    MBTypeFieldTable4_VLC,
    MBTypeFieldTable5_VLC,
    MBTypeFieldTable6_VLC,
    MBTypeFieldTable7_VLC
};
const extern Ipp32u MVModeField2RefTable0_VLC[126*2] =
{
      12,     4,    28,     5,    11,     5,     0,     5,      14,     6,    42,     7,    80,     8,   872,    10,
       2,     2,    26,     5,     4,     5,    58,     6,      29,     6,   108,     7,   239,     8,   444,     9,
     351,    10,    15,     4,     3,     5,    28,     6,      13,     6,    11,     7,    62,     8,   167,     9,
     326,    10,   409,    11,     6,     4,    31,     6,       4,     6,    60,     7,     7,     7,   446,     9,
     139,     9,    44,    10,  1971,    12,     5,     5,     219,     8,    86,     8,   236,     8,    82,     8,
     445,     9,   120,     9,   207,    10,  1395,    12,       9,     5,    35,     7,   237,     8,    24,     7,
       6,     7,    68,     8,   245,     9,   121,     9,    1746,    11,   110,     7,    43,     9,   349,    10,
      23,     9,   895,    10,   324,    10,   206,    10,      40,    10,   171,    12,    16,     6,   437,     9,
     247,     9,   166,     9,   123,     9,    40,     9,     493,    10,   489,    10,  1789,    11,     4,     7,
     245,    10,    41,    10,   650,    11,   651,    11,     655,    11,  3577,    12,   821,    12,  7813,    14,
     238,     8,   701,    11,    43,    10,   984,    11,     977,    11,   408,    11,   489,    11,  1309,    12,
     180,    12,    63,     8,  1109,    12,   555,    11,     553,    11,  1105,    12,  1400,    12,  1970,    12,
    1392,    12,   341,    13,    50,     8,   976,    12,      84,    11,  1747,    11,  1393,    12,  1108,    12,
     820,    12,  7153,    13,   183,    12,    41,     9,    7812,    14,   364,    13,   411,    11,  7152,    13,
    1401,    12,  3907,    13,   181,    12,  2209,    13,      42,     9,   365,    13,  2208,    13,  1952,    12,
     977,    12,  2789,    13,   340,    13,  2788,    13,    2617,    13,  2616,    13

};



const extern Ipp32u MVModeField2RefTable1_VLC[126*2] =
{

       3,     3,     9,     4,    22,     5,    16,     6,     215,     8,   821,    10,  1396,    11,  1365,    11,
       0,     2,    29,     5,     9,     5,    23,     6,      44,     7,   173,     8,   884,    10,  1715,    11,
    1399,    11,    15,     4,    24,     5,    10,     5,      46,     6,    34,     7,   380,     9,  3707,    12,
    7049,    13,  5592,    13,     8,     4,    52,     6,     109,     7,    35,     7,   450,     9,   886,    10,
     723,    11,  7242,    13, 13066,    14,    20,     5,     106,     7,   114,     7,   108,     7,   227,     8,
     411,     9,  1855,    11,  7408,    13,  2881,    13,      50,     6,   230,     8,   224,     8,   207,     8,
     171,     8,   412,     9,   683,    10,  3627,    12,    5593,    13,   111,     7,   451,     9,   175,     8,
     191,     8,   172,     8,   381,     9,  1763,    11,    3625,    12,  6532,    13,    84,     7,   181,     9,
     378,     9,   429,     9,   409,     9,   376,     9,     856,    10,   722,    11,  7243,    13,    91,     8,
     680,    10,   817,    10,   904,    10,   907,    10,     880,    10,  1811,    11,  3267,    12,  7409,    13,
     441,     9,  1519,    11,  1848,    11,   754,    10,     827,    10,   697,    10,  1771,    11,  1392,    11,
    3620,    12,   925,    10,  1442,    12,  1443,    12,    3709,    12,  1518,    11,  1849,    11,  1364,    11,
    2725,    12,  2724,    12,   887,    10,  7413,    13,    3022,    12,  3705,    12,  1632,    11,  1652,    11,
    1770,    11,  3708,    12,  3429,    12,   758,    10,    5594,    13,  7048,    13,  1441,    12,  7412,    13,
    1510,    11,  3624,    12,  1397,    11,  3428,    12,     820,    10, 13067,    14,  5595,    13,  2880,    13,
    3023,    12,  3525,    12,  3626,    12,  1653,    11,    1393,    11,  1363,    11
};


const extern Ipp32u MVModeField2RefTable2_VLC[126*2] =
{

       4,     4,     2,     4,    16,     5,     3,     5,      23,     6,    69,     7,    62,     8,   126,     9,
       3,     2,     2,     5,    40,     6,    30,     6,      21,     6,    71,     7,     2,     7,   333,     9,
      96,     9,    11,     4,    38,     6,    36,     6,      20,     6,    50,     7,   111,     8,   195,     9,
    1329,    11,  1765,    12,    21,     5,    63,     7,      45,     7,     1,     7,   318,     9,   221,     9,
     246,    10,   773,    11,   817,    12,    14,     5,       3,     7,    52,     7,    51,     7,    26,     7,
     330,     9,   197,     9,   244,    10,  1764,    12,       1,     5,    60,     8,   125,     8,   141,     8,
     157,     8,    49,     8,   110,     9,   662,    10,     205,    10,    37,     6,   329,     9,    50,     8,
     137,     8,    54,     8,   136,     8,   111,     9,       3,     9,   797,    11,    14,     6,   426,    10,
     638,    10,    97,     9,   334,     9,   335,     9,     103,     9,   255,    10,   387,    10,    54,     7,
     855,    11,   245,    10,   198,     9,   194,     9,     665,    10,   281,     9,   561,    10,   848,    11,
      44,     7,   399,    10,  1328,    11,   663,    10,       4,    10,   440,    10,   192,     9,   634,    10,
     785,    11,   156,     8,  1569,    12,   409,    11,     796,    11,   247,    10,   995,    11,   854,    11,
     393,    10,     5,    10,   107,     8,  2242,    12,     816,    12,  1279,    11,  1264,    11,   849,    11,
    1266,    11,   498,    10,   883,    11,     0,     8,    3137,    13,  2243,    12,  2540,    12,   994,    11,
     772,    11,  1271,    11,  1265,    11,   496,    10,     328,     9,  3136,    13,  2541,    12,  2240,    12,
    2241,    12,  1267,    11,  1278,    11,   254,    10,     499,    10,   425,    10
};



const extern Ipp32u MVModeField2RefTable3_VLC[126*2] =
{

       0,     3,     4,     4,    47,     6,    82,     7,      16,     7,   173,     9,  1291,    11,   400,    11,
       3,     2,    22,     5,     7,     5,    13,     6,     187,     8,   371,     9,   201,    10,  1295,    11,
    5932,    13,     3,     3,    17,     5,     5,     5,      67,     7,    35,     8,    75,     9,   814,    12,
   11867,    14,  1154,    13,     9,     4,    42,     6,      20,     6,    42,     7,   264,     9,  1482,    11,
    1626,    13,  8502,    14,  8498,    14,    11,     5,      19,     7,    65,     7,   184,     8,   372,     9,
     256,     9,  5338,    13, 16462,    15,  5175,    13,      43,     6,   133,     8,   167,     8,   160,     8,
     332,     9,   666,    10,   812,    12,  8499,    14,    5162,    13,    81,     7,   644,    10,   172,     9,
     258,     9,    69,     9,    68,     9,  2075,    12,    1630,    13,  3255,    14,    24,     7,  1292,    11,
     530,    10,   740,    10,   515,    10,   148,    10,     290,    11,  2074,    12,  1621,    13,    51,     8,
     698,    11,   582,    12,   578,    12,  2670,    12,    1036,    11,  2056,    12,  8500,    14, 16463,    15,
     373,     9,  1029,    11,   583,    12,   298,    11,    2580,    12,   699,    11,   401,    11,  2127,    12,
    5176,    13,   175,     9,  2967,    12,  1155,    13,    5179,    13,   811,    12,   579,    12,  5163,    13,
    2392,    14, 10687,    14,    73,     9,  2668,    12,    5339,    13,  1197,    13,  5342,    13,  2126,    12,
    5172,    13,   599,    12, 11866,    14,   519,    10,    5173,    13,  5177,    13,  3254,    14,  5178,    13,
     404,    11,  1620,    13,  8501,    14, 21372,    15,     348,    10,   576,    12,  4114,    13, 21373,    15,
    2393,    14,  4248,    13,  5174,    13,  1631,    13,    8230,    14,  8503,    14
};



const extern Ipp32u MVModeField2RefTable4_VLC[126*2] =
{

       5,     4,    25,     5,    22,     5,    17,     5,      62,     6,    94,     7,   239,     8,   226,     8,
       0,     2,    57,     6,    43,     6,    38,     6,      40,     6,    18,     6,   194,     8,   237,     9,
     285,    10,    13,     4,    49,     6,    42,     6,      37,     6,    32,     6,    92,     7,   493,     9,
     589,    10,  1904,    11,     6,     4,   122,     7,      96,     7,    79,     7,    72,     7,    57,     7,
     390,     9,   531,    10,  3782,    12,    15,     5,      38,     7,    95,     7,   117,     7,   112,     7,
      39,     7,   475,     9,   966,    10,  1935,    11,      63,     6,   166,     8,   240,     8,    58,     7,
      82,     7,    78,     7,   227,     8,   473,     9,     783,    10,    16,     6,   477,     9,   167,     8,
     247,     8,    34,     7,   146,     8,   964,    10,     751,    10,  1890,    11,   121,     7,   143,     9,
     474,     9,   135,     8,   232,     8,   186,     8,     374,     9,   238,     9,   944,    10,   133,     8,
     281,    10,   782,    10,   264,     9,   466,     9,     268,     9,  1907,    11,  1060,    11,  1076,    11,
     113,     8,  1501,    11,   449,    10,   935,    10,     295,     9,   141,     9,   539,    10,  1970,    11,
     479,    10,   984,    10,  1892,    12,  3812,    12,     947,    11,  1869,    11,   472,    10,  1500,    11,
    2122,    12,  1177,    11,   965,    10,  7566,    13,    1893,    12,  1077,    11,  1905,    11,   450,    10,
     280,    10,   956,    11,   897,    11,   903,    11,   31539,    15,  4247,    13,  4246,    13,  7885,    13,
    3737,    12,  3868,    12,  3869,    12,  3813,    12,     284,    10, 31538,    15, 15768,    14,  7567,    13,
    3736,    12,  3943,    12,   957,    11,   896,    11,    1176,    11,   902,    11
};



const extern Ipp32u MVModeField2RefTable5_VLC[126*2] =
{

      13,     4,    16,     5,    46,     6,    57,     6,      13,     6,   116,     7,   237,     8,   182,     8,
       1,     2,     2,     4,     0,     5,    48,     6,      41,     6,   112,     7,   243,     8,   140,     8,
     358,     9,     9,     4,    51,     6,   120,     7,       6,     7,   196,     8,    11,     8,   355,     9,
     204,    10,  1470,    11,    31,     5,    47,     6,     100,     7,    24,     7,   198,     8,    10,     8,
     354,     9,   704,    10,  3827,    12,     7,     5,      15,     7,   227,     8,   202,     8,   178,     8,
     399,     9,   942,    10,  1887,    11,  3153,    12,      21,     5,    71,     7,   238,     8,   226,     8,
     234,     8,     9,     8,   362,     9,   707,    10,    1437,    11,    61,     6,     8,     8,   473,     9,
      50,     8,    14,     8,   366,     9,   812,    10,    1627,    11,  6507,    13,     2,     5,    15,     8,
     472,     9,   141,     8,   180,     8,   484,     9,     103,     9,   791,    10,  1940,    11,    34,     6,
     958,    10,   789,    10,    52,     9,    55,     9,     734,    10,   108,    10,  3838,    12,  1644,    13,
      40,     6,   971,    10,   940,    10,    53,     9,     363,     9,   957,    10,   705,    10,  1580,    11,
    7678,    13,    14,     7,  1438,    11,  1471,    11,     218,    11,  1577,    11,  1412,    11,  3767,    12,
    2826,    12,  1645,    13,    12,     7,  1918,    11,    1436,    11,  1912,    11,  1886,    11,  1882,    11,
    1581,    11,   823,    12,   820,    12,   407,     9,    7767,    13,  7652,    13,  6506,    13,  7766,    13,
    3152,    12,  2879,    12,  7764,    13,  2827,    12,     398,     9,   438,    12,  7765,    13,  3252,    12,
    2878,    12,  3766,    12,  7653,    13,  7679,    13,     821,    12,   439,    12

};



const extern Ipp32u MVModeField2RefTable6_VLC[126*2]  =
{

       1,     3,      11,     5,      25,     6,     111,     8,      42,     9,    117,    10,   2027,    12,   355,    12,
       1,     1,      14,     5,      26,     6,      62,     7,      28,     8,     45,     9,    356,    12,  2028,    12,
     357,    12,       4,     4,       6,     6,      54,     7,     127,     8,    174,     9,    344,    12,   348,    12,
    1389,    14, 1037584,    21,       0,     4,       4,     6,     123,     8,    243,     9,     59,     9,  2029,    12,
     691,    13,     716,    13,    1390,    14,      24,     6,      62,     9,     23,     8,     30,     8,   175,     9,
    1015,    13,    1391,    14,     717,    13, 1037585,    21,      20,     6,    173,     9,    170,     9,    20,     8,
     168,     9,     339,    10,     232,    11,     510,    12,    3535,    13,    120,     8,    440,    10,   338,    10,
     254,    11,     689,    11,     349,    12,     352,    12, 1037586,    21,1037587,    21,    122,     8,   688,    11,
     485,    10,     233,    11,     252,    11,    1766,    12,    3528,    13,   1412,    14,1037588,    21,   171,     9,
    3550,    13,     345,    10,    1012,    11,    3529,    13,    3530,    13,    506,    12,1037589,    21,1037590,    21,
     252,     9,     511,    12,     484,    10,     175,    11,     346,    12,    359,    12,   3531,    13,  1413,    14,
  1037591,    21,   1015,    11,   16213,    15, 1037592,    21,    3548,    13,   1414,    14,  16214,    15,1037593,    21,
   16215,    15, 1037594,    21,     442,    10,    1415,    14,    1416,    14,   3551,    13,    690,    13,1037595,    21,
    3534,    13,    1014,    13, 1037596,    21,    4052,    13, 1037597,    21,1037598,    21,1037599,    21,518784,    20,
  518785,    20,    1388,    14,  518786,    20,  518787,    20,     886,    11,   1417,    14,   1418,    14,518788,    20,
  518789,    20,    3549,    13,  518790,    20,  518791,    20,    1419,    14,  32425,    16

};



const extern Ipp32u MVModeField2RefTable7_VLC[126*2]  =
{

         3,     2  ,      14,     5  ,      15,     6  ,     126,     8  ,        98,     9  ,     198,    10  ,    3289,    13  ,    1598,    13  ,
         2,     2  ,       2,     4  ,       0,     5  ,      24,     6  ,        12,     8  ,     105,     9  ,      57,    10  ,    1799,    13  ,
      3198,    14  ,       2,     3  ,      13,     5  ,      27,     7  ,        15,     8  ,     410,    10  ,    1607,    12  ,    6711,    15  ,
    214724,    20  ,   13421,    16  ,       1,     4  ,      30,     6  ,       127,     8  ,      10,     8  ,     225,    10  ,    1633,    12  ,
      3300,    13  ,  214725,    20  ,  214726,    20  ,      29,     7  ,        48,     8  ,      13,     8  ,     203,     9  ,     409,    10  ,
       800,    11  ,     142,    12  ,   25902,    16  ,  214727,    20  ,        62,     7  ,      57,     8  ,      53,     8  ,      51,     8  ,
       415,    10  ,     448,    11  ,    3290,    13  ,  214728,    20  ,    214729,    20  ,      11,     8  ,     208,    10  ,     414,    10  ,
        34,    10  ,      56,    10  ,     398,    11  ,     798,    12  ,     12948,    15  ,     572,    14  ,      50,     8  ,      18,     9  ,
        19,     9  ,     113,     9  ,     413,    10  ,      32,    10  ,      3207,    13  ,    3264,    13  ,  214730,    20  ,     824,    11  ,
      1619,    12  ,     418,    11  ,     810,    11  ,     802,    11  ,      3303,    13  ,     132,    12  ,     287,    13  ,  214731,    20  ,
       805,    11  ,    1609,    12  ,     811,    11  ,     119,    11  ,      1608,    12  ,    1602,    12  ,    3206,    13  ,    3212,    13  ,
    214732,    20  ,      58,    10  ,    6583,    14  ,      67,    11  ,       807,    11  ,     140,    12  ,     141,    12  ,    3213,    13  ,
    214733,    20  ,  214734,    20  ,     823,    11  ,    3301,    13  ,       133,    12  ,     806,    11  ,     839,    12  ,    3236,    13  ,
      3199,    14  ,    3354,    14  ,  214735,    20  ,     808,    11  ,    107360,    19  ,  107361,    19  ,    3288,    13  ,    1676,    13  ,
     12949,    15  ,   12950,    15  ,   25903,    16  ,   26328,    16  ,       817,    11  ,    1798,    13  ,     573,    14  ,     118,    11  ,
      3265,    13  ,     898,    12  ,    3302,    13  ,   26329,    16  ,     26330,    16  ,   26331,    16

};

const extern Ipp32u MVModeField1RefTable0_VLC[72*2]  =
{

         5,     3  ,      12,     4  ,      30,     5  ,      18,     5  ,        12,     5  ,      52,     6  ,     117,     7  ,     112,     7  ,
         0,     2  ,       8,     4  ,      27,     5  ,       8,     5  ,        29,     6  ,     124,     7  ,     214,     8  ,     478,     9  ,
       431,     9  ,       5,     4  ,      27,     6  ,      38,     6  ,        30,     6  ,      18,     6  ,     118,     7  ,      77,     8  ,
       502,     9  ,     500,     9  ,      57,     6  ,     127,     8  ,        39,     7  ,     106,     7  ,     113,     7  ,      53,     7  ,
       113,     8  ,     104,     8  ,     476,     9  ,      39,     6  ,       115,     8  ,     255,     8  ,     232,     8  ,     233,     8  ,
       126,     8  ,     505,     9  ,     501,     9  ,     509,     9  ,        62,     7  ,     458,    10  ,    1017,    10  ,      76,     8  ,
       105,     8  ,     506,     9  ,     479,     9  ,     503,     9  ,       112,     8  ,     477,     9  ,    3661,    13  ,    1831,    12  ,
       914,    11  ,     456,    10  ,     459,    10  ,    1016,    10  ,       430,     9  ,     504,     9  ,     507,     9  ,   58574,    17  ,
     58575,    17  ,   29280,    16  ,   29281,    16  ,   29282,    16  ,     29283,    16  ,   29284,    16  ,   29285,    16  ,   29286,    16

};



const extern Ipp32u MVModeField1RefTable1_VLC[72*2]  =
{

         7,     3  ,       1,     3  ,       7,     4  ,      22,     5  ,         1,     5  ,      69,     7  ,      24,     8  ,     694,    10  ,
         6,     3  ,       4,     4  ,      23,     5  ,      16,     5  ,        41,     6  ,      44,     7  ,     346,     9  ,     102,    10  ,
       414,    12  ,       9,     4  ,      40,     6  ,      23,     6  ,         0,     5  ,      42,     6  ,       4,     6  ,      91,     8  ,
       181,     9  ,     206,    11  ,       6,     4  ,      68,     7  ,        15,     7  ,      70,     7  ,      14,     7  ,     172,     8  ,
        50,     9  ,      55,     9  ,    4587,    13  ,      10,     5  ,        26,     8  ,     287,     9  ,      22,     8  ,      20,     8  ,
        43,     9  ,     360,    10  ,      85,    10  ,    9173,    14  ,        87,     7  ,      47,     9  ,      54,     9  ,      46,     9  ,
       361,    10  ,      84,    10  ,    1147,    11  ,     415,    12  ,     11133,    14  ,     142,     8  ,    2782,    12  ,    1145,    11  ,
      1390,    11  ,    2292,    12  ,    5567,    13  ,    1144,    11  ,      9172,    14  ,   44529,    16  ,   22265,    15  ,  712462,    20  ,
    712463,    20  ,  356224,    19  ,  356225,    19  ,  356226,    19  ,    356227,    19  ,  356228,    19  ,  356229,    19  ,  356230,    19

};

const extern Ipp32u MVModeField1RefTable2_VLC[72*2]  =

{

         2,     3  ,       6,     4  ,       7,     4  ,      13,     4  ,         7,     5  ,      48,     6  ,     255,     8  ,     496,     9  ,
         2,     2  ,       0,     4  ,       5,     5  ,      25,     5  ,        30,     5  ,       7,     6  ,      99,     7  ,     253,     8  ,
        35,     8  ,      14,     4  ,      27,     7  ,      26,     7  ,         6,     6  ,       9,     6  ,      24,     7  ,     197,     8  ,
        51,     8  ,     497,     9  ,       2,     5  ,    1019,    10  ,       499,     9  ,      34,     8  ,     508,     9  ,      66,     9  ,
      1571,    11  ,     131,    10  ,    1568,    11  ,     125,     7  ,        64,     9  ,      67,     9  ,     996,    10  ,     997,    10  ,
       401,    11  ,    4073,    12  ,     261,    11  ,     520,    12  ,       252,     8  ,    1572,    11  ,    1570,    11  ,     400,    11  ,
      1574,    11  ,    2037,    11  ,    3147,    12  ,    8144,    13  ,      4173,    15  ,     101,     9  ,    3138,    12  ,     201,    10  ,
      1575,    11  ,    3139,    12  ,    3146,    12  ,    4174,    15  ,      8145,    13  ,    4175,    15  ,    1042,    13  ,   66766,    19  ,
     66767,    19  ,   33376,    18  ,   33377,    18  ,   33378,    18  ,     33379,    18  ,   33380,    18  ,   33381,    18  ,   33382,    18

};

const extern Ipp32u MVModeField1RefTable3_VLC[72*2]  =

{

        13,     4  ,       1,     4  ,       4,     4  ,       0,     4  ,        23,     5  ,       5,     5  ,     127,     7  ,      77,     7  ,
         3,     3  ,      17,     5  ,      62,     6  ,      59,     6  ,        23,     6  ,     103,     7  ,      74,     7  ,     195,     8  ,
       242,     8  ,      10,     4  ,      44,     6  ,      50,     6  ,        61,     6  ,      21,     6  ,      40,     7  ,     147,     8  ,
       204,     8  ,     150,     8  ,       3,     4  ,     117,     7  ,        32,     6  ,      45,     6  ,      33,     6  ,      41,     7  ,
       144,     8  ,     464,     9  ,     507,     9  ,      28,     5  ,        76,     7  ,      96,     7  ,       9,     6  ,       8,     6  ,
        45,     7  ,     159,     8  ,     506,     9  ,     317,     9  ,        49,     6  ,     252,     8  ,      88,     8  ,     146,     8  ,
       240,     8  ,     241,     8  ,     205,     8  ,     389,     9  ,       357,    10  ,      78,     7  ,     145,     8  ,     233,     8  ,
       388,     9  ,     465,     9  ,     486,     9  ,     151,     8  ,       487,     9  ,     179,     9  ,     316,     9  ,    5710,    14  ,
      5711,    14  ,    2848,    13  ,    2849,    13  ,    2850,    13  ,      2851,    13  ,    2852,    13  ,    2853,    13  ,    2854,    13

};
const extern Ipp32u* MVModeField2RefTable_VLC[8] =
{
    MVModeField2RefTable0_VLC,
    MVModeField2RefTable1_VLC,
    MVModeField2RefTable2_VLC,
    MVModeField2RefTable3_VLC,
    MVModeField2RefTable4_VLC,
    MVModeField2RefTable5_VLC,
    MVModeField2RefTable6_VLC,
    MVModeField2RefTable7_VLC
};
const extern Ipp32u* MVModeField1RefTable_VLC[4] =
{
    MVModeField1RefTable0_VLC,
    MVModeField1RefTable1_VLC,
    MVModeField1RefTable2_VLC,
    MVModeField1RefTable3_VLC,
};

const extern Ipp32u CBPCYFieldTable0_VLC[64*2] =
{
        0,      0  ,   12058,    15  ,   12059,    15  ,    6028,    14  ,       144,     9  ,     680,    11  ,     681,    11  ,    3015,    13  ,
       145,     9  ,     682,    11  ,     683,    11  ,    1504,    12  ,        74,     8  ,     150,     9  ,     151,     9  ,     189,     9  ,
       146,     9  ,     684,    11  ,     685,    11  ,    1505,    12  ,       152,     9  ,     306,    10  ,     307,    10  ,     377,    10  ,
       308,    10  ,     618,    11  ,     619,    11  ,     764,    11  ,        78,     8  ,      64,     8  ,      65,     8  ,      43,     7  ,
       147,     9  ,     686,    11  ,     687,    11  ,    1506,    12  ,       310,    10  ,     622,    11  ,     623,    11  ,     765,    11  ,
       158,     9  ,     318,    10  ,     319,    10  ,     383,    10  ,        80,     8  ,      66,     8  ,      67,     8  ,      44,     7  ,
        81,     8  ,     164,     9  ,     165,     9  ,     190,     9  ,        83,     8  ,      68,     8  ,      69,     8  ,      45,     7  ,
        84,     8  ,      70,     8  ,      71,     8  ,      46,     7  ,         3,     3  ,       0,     3  ,       1,     3  ,       1,     1
};

const extern Ipp32u CBPCYFieldTable1_VLC[64*2] =
{

        -1,    -1  ,      65,     7  ,      66,     7  ,     256,     9  ,        67,     7  ,     136,     8  ,     137,     8  ,     257,     9  ,
        69,     7  ,     140,     8  ,     141,     8  ,     258,     9  ,        16,     6  ,      34,     7  ,      35,     7  ,      36,     7  ,
        71,     7  ,      16,     7  ,      17,     7  ,     259,     9  ,        37,     7  ,      88,     8  ,      89,     8  ,      90,     8  ,
        91,     8  ,      90,     9  ,      91,     9  ,      92,     9  ,        12,     6  ,      48,     7  ,      49,     7  ,      25,     6  ,
         9,     6  ,      20,     7  ,      21,     7  ,      44,     8  ,        92,     8  ,      93,     9  ,      94,     9  ,      95,     9  ,
        38,     7  ,      93,     8  ,      94,     8  ,      95,     8  ,        13,     6  ,      52,     7  ,      53,     7  ,      27,     6  ,
        20,     6  ,      39,     7  ,      42,     7  ,      43,     7  ,        14,     6  ,      56,     7  ,      57,     7  ,      29,     6  ,
        15,     6  ,      60,     7  ,      61,     7  ,      31,     6  ,         5,     3  ,       9,     4  ,       0,     3  ,       3,     2
};

const extern Ipp32u CBPCYFieldTable2_VLC[64*2] =
{
        0,      0  ,      50,     6  ,      51,     6  ,      26,     5  ,        38,     6  ,     228,     8  ,     229,     8  ,     486,     9  ,
        39,     6  ,     230,     8  ,     231,     8  ,     487,     9  ,        14,     5  ,      99,     7  ,     108,     7  ,     119,     7  ,
        40,     6  ,     232,     8  ,     233,     8  ,     488,     9  ,       123,     7  ,     218,     8  ,     219,     8  ,     236,     8  ,
       245,     8  ,     440,     9  ,     441,     9  ,     474,     9  ,        33,     6  ,      75,     7  ,      84,     7  ,      43,     6  ,
        41,     6  ,     234,     8  ,     235,     8  ,     489,     9  ,        74,     7  ,     442,     9  ,     443,     9  ,     475,     9  ,
        32,     6  ,     222,     8  ,     223,     8  ,     242,     8  ,        34,     6  ,      85,     7  ,      88,     7  ,      45,     6  ,
        15,     5  ,     112,     7  ,     113,     7  ,     120,     7  ,        35,     6  ,      89,     7  ,      92,     7  ,      47,     6  ,
        36,     6  ,      93,     7  ,      98,     7  ,      48,     6  ,         2,     3  ,      31,     5  ,       6,     4  ,       0,     2
};



const extern Ipp32u CBPCYFieldTable3_VLC[64*2] =
{
         0,     0  ,      40,     6  ,      41,     6  ,     157,     8  ,         0,     4  ,     490,     9  ,     491,     9  ,     492,     9  ,
         1,     4  ,     493,     9  ,     494,     9  ,     495,     9  ,         5,     4  ,     240,     8  ,     241,     8  ,      59,     7  ,
         2,     4  ,     496,     9  ,     497,     9  ,     498,     9  ,        63,     6  ,     348,     9  ,     349,     9  ,     153,     8  ,
        16,     6  ,     976,    10  ,     977,    10  ,     304,     9  ,        15,     5  ,     158,     8  ,     159,     8  ,     251,     8  ,
         3,     4  ,     499,     9  ,     500,     9  ,     501,     9  ,        17,     6  ,     978,    10  ,     979,    10  ,     305,     9  ,
         9,     5  ,     350,     9  ,     351,     9  ,     156,     8  ,        16,     5  ,     168,     8  ,     169,     8  ,      56,     7  ,
         6,     4  ,     242,     8  ,     243,     8  ,      77,     7  ,        17,     5  ,     170,     8  ,     171,     8  ,      57,     7  ,
        18,     5  ,     172,     8  ,     173,     8  ,      58,     7  ,         6,     3  ,      22,     5  ,      23,     5  ,      14,     4
};



const extern Ipp32u CBPCYFieldTable4_VLC[64*2] =
{

        0,      0  ,      60,     6  ,      61,     6  ,      31,     5  ,        10,     5  ,      97,     7  ,      98,     7  ,       2,     7  ,
        11,     5  ,      99,     7  ,     100,     7  ,       3,     7  ,         7,     5  ,       3,     6  ,       4,     6  ,      11,     6  ,
        12,     5  ,     101,     7  ,     102,     7  ,       4,     7  ,        18,     6  ,      10,     7  ,      11,     7  ,      20,     7  ,
        27,     7  ,      24,     8  ,      25,     8  ,      52,     8  ,        44,     6  ,     103,     7  ,     104,     7  ,      53,     6  ,
        13,     5  ,     105,     7  ,     108,     7  ,       5,     7  ,        96,     7  ,      26,     8  ,      27,     8  ,      53,     8  ,
        19,     6  ,      14,     7  ,      15,     7  ,      21,     7  ,        45,     6  ,     109,     7  ,     110,     7  ,      56,     6  ,
         8,     5  ,       8,     6  ,       9,     6  ,      12,     6  ,        46,     6  ,     111,     7  ,     114,     7  ,      58,     6  ,
        47,     6  ,     115,     7  ,       0,     6  ,      59,     6  ,         7,     4  ,      20,     5  ,      21,     5  ,       4,     3
};



const extern Ipp32u CBPCYFieldTable5_VLC[64*2] =
{

        0,       0 ,      56,     6  ,      57,     6  ,     157,     8  ,        10,     4  ,     145,     8  ,     146,     8  ,     147,     8  ,
        11,     4  ,     148,     8  ,     149,     8  ,     150,     8  ,         3,     4  ,     238,     8  ,     239,     8  ,      54,     7  ,
        12,     4  ,     151,     8  ,     152,     8  ,     153,     8  ,         8,     5  ,     484,     9  ,     485,     9  ,     106,     8  ,
        24,     6  ,     972,    10  ,     973,    10  ,     214,     9  ,        14,     5  ,     158,     8  ,     159,     8  ,     245,     8  ,
        13,     4  ,     154,     8  ,     155,     8  ,     156,     8  ,        25,     6  ,     974,    10  ,     975,    10  ,     215,     9  ,
         9,     5  ,     488,     9  ,     489,     9  ,     144,     8  ,        15,     5  ,     232,     8  ,     233,     8  ,     246,     8  ,
         5,     4  ,     240,     8  ,     241,     8  ,      55,     7  ,        16,     5  ,     234,     8  ,     235,     8  ,     247,     8  ,
        17,     5  ,     236,     8  ,     237,     8  ,      52,     7  ,         0,     3  ,      62,     6  ,      63,     6  ,       2,     4
};



const extern Ipp32u CBPCYFieldTable6_VLC[64*2] =
{

         0,     0  ,      60,     6  ,      61,     6  ,     463,     9  ,         0,     3  ,     191,     8  ,     224,     8  ,     508,     9  ,
         1,     3  ,     225,     8  ,     226,     8  ,     509,     9  ,         9,     4  ,     497,     9  ,     498,     9  ,     499,     9  ,
         2,     3  ,     227,     8  ,     228,     8  ,     510,     9  ,        17,     5  ,    1006,    10  ,    1007,    10  ,    1008,    10  ,
        33,     6  ,    2018,    11  ,    2019,    11  ,    2020,    11  ,        24,     5  ,    1015,    10  ,    1022,    10  ,    1023,    10  ,
         3,     3  ,     229,     8  ,     230,     8  ,     128,     8  ,        46,     6  ,    2021,    11  ,    2022,    11  ,    2023,    11  ,
        22,     5  ,    1012,    10  ,    1013,    10  ,    1014,    10  ,        25,     5  ,     258,     9  ,     259,     9  ,     260,     9  ,
        10,     4  ,     500,     9  ,     501,     9  ,     502,     9  ,        26,     5  ,     261,     9  ,     262,     9  ,     263,     9  ,
        27,     5  ,     376,     9  ,     377,     9  ,     462,     9  ,        29,     5  ,     189,     8  ,     190,     8  ,     496,     9
};


const extern Ipp32u CBPCYFieldTable7_VLC[64*2] =
{

         0,     0  ,       3,     6  ,       4,     6  ,     438,    10  ,         4,     3  ,      46,     7  ,      47,     7  ,      14,     7  ,
         5,     3  ,      48,     7  ,      49,     7  ,      15,     7  ,         3,     4  ,      10,     8  ,      11,     8  ,      20,     8  ,
         6,     3  ,      50,     7  ,      51,     7  ,      16,     7  ,         5,     5  ,      48,     9  ,      49,     9  ,      50,     9  ,
         9,     6  ,     102,    10  ,     103,    10  ,     104,    10  ,        29,     6  ,     439,    10  ,     440,    10  ,     441,    10  ,
         7,     3  ,      52,     7  ,      53,     7  ,      17,     7  ,        22,     6  ,     105,    10  ,     106,    10  ,     107,    10  ,
        10,     5  ,      54,     9  ,      55,     9  ,     216,     9  ,        30,     6  ,     442,    10  ,     443,    10  ,     444,    10  ,
         4,     4  ,      21,     8  ,      22,     8  ,      23,     8  ,        31,     6  ,     445,    10  ,     446,    10  ,     447,    10  ,
         0,     5  ,      16,     9  ,      17,     9  ,      18,     9  ,        28,     6  ,     217,     9  ,     218,     9  ,      19,     9
};
const extern Ipp32u* CBPCYFieldTable_VLC[8] =
{
    CBPCYFieldTable0_VLC,
    CBPCYFieldTable1_VLC,
    CBPCYFieldTable2_VLC,
    CBPCYFieldTable3_VLC,
    CBPCYFieldTable4_VLC,
    CBPCYFieldTable5_VLC,
    CBPCYFieldTable6_VLC,
    CBPCYFieldTable7_VLC
};
const extern Ipp8u MVSizeOffsetFieldIndex [256]=
{
    0   ,
    1   ,
    2   ,
    2   ,
    3   ,
    3   ,
    3   ,
    3   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8
};
const extern Ipp8u MVSizeOffsetFieldExIndex [512]=
{
    0   ,
    1   ,
    1   ,
    2   ,
    2   ,
    2   ,
    2   ,
    3   ,
    3   ,
    3   ,
    3   ,
    3   ,
    3   ,
    3   ,
    3   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    4   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    5   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    6   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    7   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8   ,
    8
};
const extern Ipp16s MVSizeOffsetField [10] =
{
    0, 1, 2, 4, 8, 16, 32, 64, 128, 256
};
const extern Ipp16s MVSizeOffsetFieldEx [10] =
{
    0, 1, 3, 7, 15, 31, 63, 127, 255, 511
};
//////////////////////////////////////////////////////////////////////////////////////////////
}

#endif // defined (UMC_ENABLE_VC1_VIDEO_ENCODER)

